> How can I make this more smooth?  I was thinking of threads, 
Threads is definitely the way to go.
 
> but I
> couldn't figure out how to stop the process if, for example, the user
> hit cancel or something.
My opinion is that you should call the sub program asynchronously to get
it's PID, when the user hits cancel you just kill the process with a
kill SIGHUP or SIGTERM. I am currently using this approach in a C
program. When i want to check if the program is running I launch a
thread which emits a kill(PID, 0) on a loop. I don't think this is a
portable solution though, if that's the case. Don't forget that if you
need to interact with the UI you have to do it throught the main loop,
issuing a g_idle call (at least in C that's how it's called).

Tiago Cogumbreiro

_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to