[pygtk] interference between gtk.gdk.threads_init() and
radek.vykydal at grisoft.cz
Thu Aug 11 22:32:46 WST 2005
On Thu, 2005-08-11 at 15:26 +0100, Gustavo J. A. M. Carneiro wrote:
> 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)
unfortunately, I must use pygtk 2.0
More information about the pygtk