Thank you all! (and another question :) ) Was: Proper way to fork() a GTK program





Hello, everyone! 

Thank you so much for help, I've changed to _exit() in forked child
and everything works now. Now I can run an external process with
stderr redirected to a text widget (and if the process cares to say
"ERROR" or "WARNING" it is drawn in bright colors and popup window
pops up on ERRORs). If someone cares ask me for a code snippet... ;-)

I also have another question. Is there a "standard" way to save the
state of the GTK program (e.g., all checkbuttons state, text entry
field state, etc.) and then restore it?

Anyway, I just get to LOVE GTK --- without any previous GUI
programming experience in two days I've built an application which
really impressed my co-worker who has lots of Motif experience. ;-)

Paul 

Lars Hallberg writes:
 > On Mon, Mar 08, 1999 at 10:38:22AM -0500, Paul Bunyk wrote:
 > 
 > > 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,
 > 
 > I'm a newbe myself but have catched up on this list that You have to
 > exit forked procesess with _exit() insted of exit() cose exit() will
 > close the gtk session to X.
 > 
 > HTH (some) /Lars

-- 
  ("`-''-/").___..--''"`-._   UNIX *is* user-friendly, he is just very 
   `6_ 6  )   `-.  (     ).`-.__.`) picky about who his friends are...
   (_Y_.)'  ._   )  `._ `. ``-..-'      Paul Bunyk, Research Scientist
 _..`--'_..-_/  /--'_.' ,'art by           (and part-time UN*X sysadm)
(il),-''  (li),'  ((!.-' F. Lee http://pbunyk.physics.sunysb.edu/~paul



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]