fanticla has asked for the wisdom of the Perl Monks concerning the following question:
Dear monks,
I have a script (TK) doing a database import. When loading a database into a TK-table, a notification window pops up telling the user that the script is processing the database. I’d like the windows pops up only after x-seconds of loading processing (just not to annoy the user if the process lasts only milliseconds). Unfortunately I have no idea how to implement this. So far I have:
sub import { #pop-up notification of import our $notification = $mw->Toplevel(); $notification->geometry('+400+400'); $notification->overrideredirect(1); $notification->withdraw; $notification->Label( -text => " Please wait, I am working... ", -foreground => 'white', -background => 'black', -height => 5 )->pack; display_notification(); #------------------------------------- # DOING THE LOADING HERE #------------------------------------- hide_notification(); } sub display_notification { $notification->deiconify; $notification->raise; } sub hide_notification { $notification->withdraw; }
How can I delay the pop-up window, let’s say I want to show it only if the loading time is more than 2 seconds? Should I use fork? Any idea would be very much appreciated. Thanks, Cla
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Showing pop-up window after x-seconds processing
by Corion (Patriarch) on Aug 07, 2010 at 09:16 UTC | |
by fanticla (Scribe) on Aug 07, 2010 at 09:51 UTC | |
by Corion (Patriarch) on Aug 08, 2010 at 08:26 UTC |