> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 08, 2001 4:03 PM
> To: [EMAIL PROTECTED]
> Subject: using a window while process is running in pTk
>
>
> I created a program in ptk that basically takes a file in,
> splits it up and
> runs a process on each file, these can be run simultaneously
> or on after
> another. I'm using system( ) to kick off each process. The
> problem is that
> once I RUN this, I can't use the window until the processing
> is complete!!!
> The window gets greyed if another window is opened on it and
> minimized( I
> think you can get the picture). I was hoping to create a
> status window to
> tell how many jobs have completed, and how many more to go,
> etc... Does
> anyone know if there is a way to get around this! I can't seem to find
> anything on this in the O'Reilly's Learning P/TK book!
> Thanks
> Tom
A system($cmd) call essentially does this:
defined($pid = fork) || die "Couldn't fork\n";
exec($cmd) unless $pid; # in child, exec() command
wait; # in parent, wait for child to finish
To have a status window, you need to have the parent keep running instead
of waiting for the child. So you have to do the fork business yourself.
Read perldoc perlipc, and read the examples in the Camel and Ram books.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]