On Thu, 2005-08-11 at 16:21 +0200, Radek Vykydal wrote:
> Hello,
> 
> I wrote a python module which forks and execes a child.
> In the parent I made (with signal.signal()) handler to
> catch SIGCHLD and the parent calls gtk.main() to wait for the
> child's exit(). The SIGCHLD handler calls os.waitpid()
> and gtk.main_quit().
> 
> The module works fine alone, but when I incorporate it
> into application which is calling gtk.gdk.threads_init() before
> running it's mainloop, the
> SIGCHLD handler isn't called (after the the child's exit()).
> 
> Could you tell me the reason and, possibly, recommend me
> how I can wait for the child in better way?

(requires pygtk >= 2.6)

def child_cb(pid, status):
    # do something

gobject.child_watch_add(pid, child_cb)

> 
> Thanks,
> 
> Radek
> 
> _______________________________________________
> pygtk mailing list   [email protected]
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
-- 
Gustavo J. A. M. Carneiro
<[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
The universe is always one step beyond logic

_______________________________________________
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