Re: Periodic and cross platform timers or alarms



Thanks for the info but you now made me think of another question.

While in the callback, if I determine that I need to perform a task that could "take a while", do I need to be worried that the alarm or signal could be called again. If so, is there a way to suspend it so it won't be called again until I finish with the current callback or do I need to use a g_source_remove and then before I return do another g_timeout_add.

Ben Johnson wrote:

On Wed, Aug 10, 2005 at 01:16:10PM -0500, Douglas Vechinski wrote:
...
Does GTK+ or GLIB provide any type of repeating timers or alarms?  I'm
looking for a portable way (Linux and XP).  Unix has "alarm" and XP has
other timers I believe but was looking for something that might be
common to both.

this registers a callback:

http://www.gtk.org/api/2.6/glib/glib-The-Main-Event-Loop.html#g-timeout-add


and (I think I got the right one here), you can use this function to
stop the timer outside of the timeout callback:

http://www.gtk.org/api/2.6/glib/glib-The-Main-Event-Loop.html#g-source-remove


_______________________________________________
gtk-list mailing list
gtk-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-list





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