Re: GLIB - GMainLoop and Timeouts



On Sat, 2003-05-03 at 13:21, Nelio Pereira wrote:
> Hi there..
> 
> As I didn't find a specific list on glib, I decided to
> ask you guys a question about the GMainLoop structure.
> 
> My doubt is: how can I change the timeout for a given
> timeout event already defined? I didn't find anything
> about this.
> 
> I could accomplish this by destroying the timeout, and
> then creating another one. However, I think this
> way I'll overflow the source_id. Am I thinking right?

Removing and adding the timeout is the right way to do it.

It takes a long time to overflow a 32-bit number; but
if that's really a concern, you can you use 
g_timeout_source_new(), g_source_set_callback(),
g_source_attach() directly; one reason we introduced
those API's for GLib-2.0 was to get rid of the source_id
dependency.

Regards,
                                     Owen





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