[10449] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

[gtk-list] Timer signal results in "Alarm clock"

daemon@ATHENA.MIT.EDU (Andre' Karwath)
Wed Nov 25 13:54:29 1998

Date: Wed, 25 Nov 1998 19:50:09 +0100
From: "Andre' Karwath" <Andre.Karwath@informatik.tu-chemnitz.de>
To: gtk-list <gtk-list@redhat.com>
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com

Hello,

I'd like to connect the timer signal SIGALRM to a signal handler

  signal (SIGALRM, timer_signal_handler);

and start the timer

  itimerval t;
  t.it_value.tv_sec=1;
  t.it_value.tv_usec=0;
  setitimer (ITIMER_REAL, &t, NULL);

All this works fine if I start the timer before I call gtk_main () and
the timer_signal_handler function gets called as usual. But if I setup
the timer after gtk_main (), the program stops after the adjusted time
with the message "Alarm clock".

Now, I really would like to avoid this message and the stopping of my
program, as well. I need to react myself within timer_signal_handler.

I'm sure, there exists a solution ;) Have anyone a good idea?

Thanks a lot.


-- 
 _____  _   _  _____
(  _  )( ) ( )(  _  )                       PENGUINS ARE COOL
| (_) || |/'/ | (_) |
|  _  || , <  |  _  | ---------------------------------------
| | | || |\ \ | | | | andre.karwath@informatik.tu-chemnitz.de
(_) (_)(_) (_)(_) (_)          http://www.tu-chemnitz.de/~aka

-- 
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post