|There's more than one way to do things|
Re^3: Perl/Tk window contents disappear when obscured then revealedby BrowserUk (Pope)
|on Jan 22, 2013 at 18:54 UTC||Need Help??|
Do feel free to correct me if you still think MainLoop is appropriate here.
The nature of GUI's is that whenever a window (or part thereof) is uncovered; or has its size changed, you have to re-draw the contents of that window.
To achieve that you can call $->update() within long running loops; but that will often mean that updates are forced each time around the loop when they are not needed -- ie. you chew CPU for no reason -- or you can enter the event loop (MainLoop;) which will monitor the event queue and call update() only when it is required; along with servicing any and all other events as they occur.
If you have a piece of code to run that is going to take more than say 1/10th of a second, then you have three choices:
What is this program that you are running in the background? Does it produce output that you need in your GUI application? Does it produce a file that you then need to read?
If you supply more details; we might be able to recommend a better way of tackling the problem.
This can be finely tuned by only calling for the duration.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.