From: Mattia B. <mb...@ds...> - 2002-02-23 13:41:47
|
> Hi all.. > First, thanks for the great wxPerl tool! I=B4m a newbie both to Perl and > wxWindows so i am having some hard times to get things working but > slowly my script gets looking user friendly. > > I'm writing a GUI wrapper on Windows 2000 with Activestate to a > 'untouchable' perl script, and for that i am using the open function to > get the output of the other script into a log window in the GUI. That > part look like this: > > open STATUS, "theotherscript.bat -s$settings{SERVER} -check 2>&1 |" > or die "can't fork: $!"; > while (<STATUS>) { > $this->{TEXTWINDOW}->AppendText($_); > } > close STATUS or $this->{TEXTWINDOW}->AppendText("-- ABNORMAL TASK > PROCESS ENDING. See log window for details. \n"); > > Now, if i stay at the window with the TextCtrl it works fine, i see the > output popping up while processing. But this can take a few minutes so > it will happen a lot that the user goes to another program, lets say to > check his mail. If he clicks the wxPerl tab again to see how it is going > nothing happens, the GUI will only come back when the child process > ends. Why?, can i change this behaviour? The problem is that you are stuck in an event handler, so the event loop isn't processing new events. The 'real' solution for this is using Wx::Process, that will be in the next release ( to be released Really Soon ); as a workaround you could put a Wx::Yield call right after the ->AppendText call this way the GUI will be responsve only during the Wx::Yield call, though Regards Mattia |