In your timeout function, you can re-add the function with a new timeout interval, and then return FALSE to remove the timeout with the old interval:
gboolean my_timeout_function(gpointer data) { // do stuff // ... if(need_to_change_interval) { g_timeout_add(new_interval, (GSourceFunc)my_timeout_function, data); return FALSE; } return TRUE; }
ptomato
source share