From: Alejandro F. <af...@st...> - 2002-02-25 15:43:40
|
Thanks, it worked fine! Sometimes the process pieces between appends/yields are a bit long but it= is responsive enough. I finally used Wx:SafeYield to disable the rest of the controls (they are mainly settings), hope this has no side-effect. The Yield call seems to have no noticeable effect on process speed too. Regards, Alejandro. Mattia Barbon wrote: > > 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 t= he > > output popping up while processing. But this can take a few minutes s= o > > 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 go= ing > > 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 |