in reply to Re: How to PopUp a 'Status' window in Perl/Tk
in thread How to PopUp a 'Status' window in Perl/Tk
Let me rephrase the OP's question. I believe the OP wants to remove the cancel button from the AddItem sub so that the popup window it is creating has no way to exit from the user (well, the window close button that the window manager puts in automatically may be there, but we can work on that later). This window will be visible for the duration while the perl program continues to do stuff in the background to prepare whatever, e.g., sleep 3.
And then, once this setup is done, the OP wishes that this extra status window disappears as if the user had pressed the (now-removed) cancel button.
In other languages, my first thought is to create a background thread to do the real work in, leaving the main loop on the main thread free to handle events. However, I've not done GUI programming in ages - last time I did any GUI programming on Unix was when I was learning Java, and, before that, all GUI programming had been Win16, OS/2, and Win32 - in C and Delphi Pascal. Java handles threads in a relatively transparent method, with sensible sharing, IMO. Perl's threads ... well, I'd love to hear the answer to the OP to see how I can take advantage of it in other stuff I'd like to do ;-)
|
|---|