- From: Owen Taylor <otaylor gtk org>
- To: Sascha Ziemann <szi aibon ping de>
- Cc: gtk-list redhat com
- Subject: Re: g_coprocess()
- Date: 17 May 1998 17:43:59 -0400
Sascha Ziemann <firstname.lastname@example.org> writes:
> does anybody have a function that forks a Gtk+ program and starts a
> child program in order to write to the child and read it's output.
KanjiPad (http://www.gtk.org/~otaylor/kanjipad/) does this.
(The important function is init_engine() in kanjipad.c)
There may be some things it doesn't do quite right (For one
thing, since the child is supposed to last as long as the
parent, it doesn't bother to wait() for the child. If the
child exited before the parent, then you'd get a zombie),
but it should get you started.
The main thing to watch out for is to use _exit() instead
of exit() in the child, so the child doesn't try to clean
up the parent's X connection.
] [Thread Prev