From: Piske, Harald <Harald.Piske@bo...> - 2001-04-01 18:24:43
> What is the best way how to refresh the window and show users
> that the program is still running? Thank you for any good idea.
introduce Win32::GUI::DoEvents() from time to time.
look at "RE: [perl-win32-gui-users] Looping Question" for an implementation
From: Piske, Harald <Harald.Piske@bo...> - 2001-04-04 16:16:32
| >time returns back to my program.The window created by my
| >program is
| >not refreshed immediately to the state before switching but I must
| >wait until my program writes to that window.
| The Window class has the Activate() event. Maybe some other
| control has
| something similar that you can use. Otherwise maybe the Timer
| control can
| help you, but that might ivolve performance issues. Time
| things and find out.
we had this posting twice before. Maybe my reply escaped you - or maybe what
I suggested didn't work. But from my understanding, the window can only
refresh when the respective, system-generated Paint messages get processed.
As long as one of your event handlers is running and does not return, the
messages just sit there and wait. If this is the cause of the problem, the
Activate sub won't help, because the Activate message, too, would not get
processed. If you haven't already, put
in the sub that runs so long, at a place inside the loop, so that it gets
called often. It does not do anything if there are no messages waiting, so I
guess it's not much of a performance issue.
As for your other question - how to let the user know the program's still
alive - that's what progress bars do a good job at. Or a textfield with a
counter. If, as you say, the window refreshes as soon as you write to your
log field, then writing a countdown might solve both issues.
Hope that helps,
Get latest updates about Open Source Projects, Conferences and News.