NeonFlash has asked for the wisdom of the Perl Monks concerning the following question:
I have created a scheduled task on Windows 7 which runs a Batch File at a specified interval.
This batch file in turn invokes a Perl Script. Inside the Perl Script, based on the result, I use Perl Tk to display a Popup Message which gives an Alert.
Now, while I am doing some other task on my machine, like Browsing Internet, the Browser Window will be the active window for instance. In between, the scheduled task runs and the popup Window is not displayed, instead it is minimized and displayed on the Task Bar.
Please note that I am using, htstart.exe from ntwind to avoid displaying the Console Window when the Scheduled task runs (otherwise, taskeng.exe shows up everytime the scheduled task runs).
In order to make my Perl Tk window as the active window, I am creating the window as shown below:
$mw = MainWindow->new(-background => 'blue'); $mw->focus(-force); $mw->geometry("200x200"); $mw->title("Message"); $mw->Label(-text => 'A Message', -background => 'white', -font => 'big +')->pack(); $mw->Button(-text => "Close", -command =>sub{exit})->pack(); MainLoop;
I have set the focus option so that this window becomes active.
Now, when the scheduled task runs, the only difference I observed after setting the focus option is that, the Tk Window appears in the Taskbar and it keeps blinking (probably because it is set as the active window now).
How do I make sure, that when it is displayed, it appears in the foreground and does not get minimized to the Task Bar?
Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl Tk Active Window
by zentara (Cardinal) on Aug 18, 2012 at 09:19 UTC | |
|
Re: Perl Tk Active Window
by rpnoble419 (Pilgrim) on Aug 18, 2012 at 18:39 UTC | |
|
Re: Perl Tk Active Window
by Anonymous Monk on Aug 18, 2012 at 06:27 UTC | |
by NeonFlash (Novice) on Aug 18, 2012 at 06:47 UTC |