Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: perl Tk focus question

by dree (Monsignor)
on Aug 22, 2002 at 22:20 UTC ( #192193=note: print w/ replies, xml ) Need Help??


in reply to perl Tk focus question

You can use the grab() function for the second window.
See the example below:

use strict; use Tk; my $mw = MainWindow->new( -height => 385, -width => 575); $mw->title ("Example"); #---------- Adding Button my $button = $mw->Button( -text => "Click me!", -relief => "raised", "-command"=>\&Click_me, ); $button->place( -x => 215, -y => 295, -height => 22, -width => 90); MainLoop; sub Click_me { my $mw2 = $mw->Toplevel( -height => 123, -width => 245); $mw2->title (""); $mw2->grab(); }


Comment on Re: perl Tk focus question
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://192193]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (15)
As of 2015-07-03 12:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (51 votes), past polls