Ace128 has asked for the wisdom of the Perl Monks concerning the following question:
use Tk; use Tk::StayOnTop; use strict; use warnings; #use diagnostics; my $frame = new MainWindow; #my $frame = $mw->Toplevel(-title => "Hide/Show testing"); #$frame->stayOnTop(); $frame->withdraw; $frame->after(1000, sub {$frame->stayOnTop(); }); $frame->after(2000, sub {$frame->deiconify; }); $frame->after(10000, sub {$frame->withdraw; }); $frame->after(20000, sub {$frame->deiconify; }); $frame->after(25000, sub {$frame->withdraw; }); ¢erWindow($frame, 150, 150); MainLoop; sub centerWindow { my($window, $width, $height) = @_; $width = $window->reqwidth unless $width; $height = $window->reqheight unless $height; my $x = int(($window->screenwidth / 2) - ($width / 2)); my $y = int(($window->screenheight / 2) - ($height / 2)); $window->geometry("=${width}x${height}+${x}+${y}"); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tk window still ontop but no focus
by Anonymous Monk on Oct 21, 2005 at 14:18 UTC | |
by Ace128 (Hermit) on Oct 21, 2005 at 15:07 UTC |