On Fri, 15 Dec 2000, Robert Sherman wrote:
> any idea as to why in the script below, in sub Button2_Click, TextField1
> does not change to "Processing..." prior to running the process_file
> sub? A similar call in the process_file sub changes the field to "Done!"
> when it finishes, and that call works fine...
> $Window->TextField1->Text("Processing...");
> &process_file($file, $front, $end);
The Text method is queueing a message to TestField1 to change, but that
message cannot be acted upon until the current *_Click event exits.
What ends up happening is that process_file runs, then afterward the text
changes twice quickly as the messages are processed.
How to fix it? I don't have enough experience with Win32::GUI. You could
set a timer to execute process_file. Other ways would be to post a
message which triggers a callback and put it in there. You could also try
putting a yield in front of process_file. Yield will usually cause events
to be processed.
Just guessin'
- Eric B.