in reply to perlTK always-on-top \ topmost in linux
Maybe I'm misinterpreting what you want to do, maybe you just want to call $toplevel->raise if it isn't on top? You can test for window visibility, and raise it if it isn't visible.
#!/usr/bin/perl use Tk; $mw = tkinit; $t = $mw->Toplevel; $t->withdraw; $t->Label(-text => "Testing...")->pack; $t->Button( -text => "Withdraw", -command => sub {$t->withdraw}, )->pack; $t ->overrideredirect(1); #to top on all virtual desktops $mw->Button( -text => 'Test', -command => sub { $_->deiconify, $_->raise for $t; }, )->pack; MainLoop;
Also you might want to check out the Tk::Wm perldoc. The following dosn't work on fvwm2, but is reported to work on KDE.
#from comp.lang.perl.tk #The following works, at least with KDE 2. I would be glad to #here su +ccess reports for KDE 3. #Regards, Slaven Rezic use Tk; $top = new MainWindow; keep_on_top($top); MainLoop; sub keep_on_top { my $w = shift; my($wrapper) = $w->toplevel->wrapper; $w->property('set', '_NET_WM_STATE', "ATOM", 32, ["_NET_WM_STATE_STAYS_ON_TOP"], $wrapper); } __END__
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: perlTK always-on-top \ topmost in linux
by eserte (Deacon) on Aug 24, 2004 at 10:00 UTC |