Help, How to mange the id returned by g_timeout_add

2006-07-07 Thread chao yeaj
Hello,all You know ,we can register a timeout function using g_timeout_add and g_timeout_add return an ID And,we must mannually remove the timeout function using g_source_remove The problem is,in my application,there are several timeout functions ,in many modules In my ap

Re: Help, How to mange the id returned by g_timeout_add

2006-07-07 Thread Micah Carrick
Well, I'm hardly the expert, but I typically declare things like that in main() and pass them to the routines and callbacks as userdata if it's needed. For example, let's say you have an array of guint's to hold each of your timer id's (or if you don't know how many you'll have, perhaps a GSlis

Re: Help, How to mange the id returned by g_timeout_add

2006-07-09 Thread Anna
In C, I handle it by creating file-scoped variables. not quite global, but not local either. If you want to remove as much risk as possible, I'd recommend declaring a file-scoped variable in a file with only the few functions that actually need to access the variable directly. (then, call it a "m

Re: Help, How to mange the id returned by g_timeout_add

2006-07-12 Thread chao yeaj
On 7/9/06, Anna <[EMAIL PROTECTED]> wrote: > In C, I handle it by creating file-scoped variables. not quite global, > but not local either. If you want to remove as much risk as possible, > I'd recommend declaring a file-scoped variable in a file with only the > few functions that actually need t