Re: gtk_timeout_add() wierdness



Hi,

Kris Kersey <augustus linuxhardware org> writes:

> I'm a new gtk programmer and having a stabge problem when using
> gtk_timeout_add().  I am calling gtk_timeout_add() with:
> 
> timer = gtk_timeout_add( 1000, (GtkFunction) update_sensor_data,
>             (gpointer) data );
> 
> My update function looks like:
> 
> gint update_sensor_data( gpointer data ) {
[snip]
>     return (TRUE);
> }
> 
> With this setup gtk will execute the function only once.  This is not the
> desired behavior as I want it to continue to repeat.


returning TRUE from a timeout handler removes the timeout source.
You want to return FALSE instead.


Salut, Sven



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