> > 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
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
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
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); /*
[EMAIL PROTECTED] wrote:
> static void signal_handler(int sig)
> {
> switch (sig) {
> case SIGINT:
> puts("SIGINT signal catched");
> break;
> case SIGTERM:
> puts("SIGTERM signal catched");
>
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
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