more useful options | |
PerlMonks |
Re^5: Problems with Tk::SplashScreen and Tk::Splashby zentara (Archbishop) |
on Jun 17, 2005 at 13:16 UTC ( [id://467696]=note: print w/replies, xml ) | Need Help?? |
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
In Section
Seekers of Perl Wisdom
|
|