Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: How to bring a Tk window to the top

by converter (Priest)
on May 06, 2003 at 16:53 UTC ( #255939=note: print w/ replies, xml ) Need Help??


in reply to How to bring a Tk window to the top

If the toplevel hasn't been mapped yet or has been withdrawn you'll want to invoke the deiconfiy method to make sure the window is mapped in de-iconified form, and then the raise method to bring the window to the top of the stacking order. The Tk::Widget and Tk::Wm man pages should be helpful.

This quickie demo should give you a good start:

use Tk; $mw = tkinit; $t = $mw->Toplevel; $t->withdraw; $t->Label(-text => "Testing...")->pack; $t->Button( -text => "Withdraw", -command => sub {$t->withdraw}, )->pack; $mw->Button( -text => 'Test', -command => sub { $_->deiconify, $_->raise for $t; }, )->pack; MainLoop;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2016-07-29 05:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?


















    Results (259 votes). Check out past polls.