RE: SIGINT with gtk_main

2007-03-26 Thread Michiel De Hoon
> > For my application, I need to run gtk_main but I want to quit gtk_main > > when either input is available on stdin or the user presses Ctrl-C. ... > > Chris wrote: > You can write to a pipe in the signal handler (assuming you are using Unix as > your question implies), as write() is async-sign

Re: SIGINT with gtk_main

2007-03-25 Thread Andreas Stricker
Chris Vine wrote: > On Wednesday 21 March 2007 17:50, Michiel Jan Laurens de Hoon wrote: > >>For my application, I need to run gtk_main but I want to quit gtk_main >>when either input is available on stdin or the user presses Ctrl-C. [snip] > > You can write to a pipe in the signal handler (assu

Re: SIGINT with gtk_main

2007-03-22 Thread Chris Vine
On Wednesday 21 March 2007 17:50, Michiel Jan Laurens de Hoon wrote: > For my application, I need to run gtk_main but I want to quit gtk_main > when either input is available on stdin or the user presses Ctrl-C. The > former is easy (using g_io_add_watch), but I am not sure what the best > approach

Re: SIGINT with gtk_main

2007-03-22 Thread Chris Vine
On Wednesday 21 March 2007 20:59, [EMAIL PROTECTED] wrote: [snip] > Hi, > > maybe adding this to main > > /*signal(SIGHUP,SIG_IGN); *//* ignore SIGHUP */ > /*signal(SIGTERM,signal_handler);*/ /* catch SIGTERM */ > signal(SIGINT,signal_handler); /*

Re: SIGINT with gtk_main

2007-03-21 Thread Michiel Jan Laurens de Hoon
[EMAIL PROTECTED] wrote: > static void signal_handler(int sig) > { > switch (sig) { > case SIGINT: > puts("SIGINT signal catched"); > break; > case SIGTERM: > puts("SIGTERM signal catched"); >

Re: SIGINT with gtk_main

2007-03-21 Thread zz
On Wednesday 21 March 2007 18:50:38 Michiel Jan Laurens de Hoon wrote: > For my application, I need to run gtk_main but I want to quit gtk_main > when either input is available on stdin or the user presses Ctrl-C. The > former is easy (using g_io_add_watch), but I am not sure what the best > app

SIGINT with gtk_main

2007-03-21 Thread Michiel Jan Laurens de Hoon
For my application, I need to run gtk_main but I want to quit gtk_main when either input is available on stdin or the user presses Ctrl-C. The former is easy (using g_io_add_watch), but I am not sure what the best approach is to handle Ctrl-C. Right now I am using g_timeout_add to check every 1