Proper way to fork() a GTK program (to exec() something)
- From: Paul Bunyk <paul pbunyk physics sunysb edu>
- To: gtk-list redhat com
- Subject: Proper way to fork() a GTK program (to exec() something)
- Date: Mon, 8 Mar 1999 10:38:22 -0500 (EST)
Operating System: Linux 2.2.2 #2 SMP Thu Feb 25 13:34:47 EST 1999
Content-Type: text
Content-Length: 1033
Hello, everyone!
I'm writing my first GTK program which is just a GUI wrapper
around several (large) programs which should allow one to
specify parameters and click buttons to start one or another
program.
Making the interface itself was a really pleasurable experience
(especially with the help of GLADE), but now I came to the hard part.
What I want to do it to fork my GUI process, in child freopen stdin/stdout
and switch stderr to a pipe (which in parent process will be printed out
in a text box) then exec my program. When I do it in straightforward way
I get "x io" and "lost x sequence" errors, especially if I try to
call gtk_widget_show(errorDialog) from the child process.
Are there any rules how should I do that? E.g., can I just use exit() my
child process (if something goes wrong before exec), or I should use
gtk_exit()?
Maybe someone has a code snippet which does something similar? I'd love
to see that! ;-)
Sincerely,
Paul
P.S. a Cc: paul@pbunyk.physics.sunysb.edu would be appreciated! :)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]