Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^5: Problems with Tk::SplashScreen and Tk::Splash

by zentara (Archbishop)
on Jun 17, 2005 at 13:16 UTC ( [id://467696]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Problems with Tk::SplashScreen and Tk::Splash
in thread Problems with Tk::SplashScreen and Tk::Splash

Sorry, I realize you may have used sleep for a quick demo, but I just have to "pick this bone" whenever I see sleep used in GUI code, so that newbies won't think that it is okay to throw sleep into the Tk or gtk2 scripts. The only place sleep should ever be seen in a Tk app is in a thread or after a fork-and-exec. You did notice that your code ran fine without the sleep statements? So it wasn't a problem with the splash screen, it was a problem with sleep in your example. And probably a design problem, where you are trying to use the splash screen as a "please-wait-loading" indicator for your data.

Sleep in a GUI actually STOPS the GUI event loop from working at all, and using it to demonstrate that some GUI function isn't working, is never the right thing to do. Its like pulling the plug, to demonstrate that the toaster isn't working.

Sleep stops the "execution pointer" from moving, and in a GUI it must be kept moving. Otherwise the splash will not be destroyed at the desired time, because it's counter was'nt running due to the sleep command.

Now in your particular case, the sleep demonstrated the problem, but for all the wrong reasons, which is totally misleading. Once again sorry, if I tried to beat you over the head with this. :-)


I'm not really a human, but I play one on earth. flash japh

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2024-03-28 11:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found