[maemo-developers] [maemo-developers] Re: [maemo-users] Using osso_iap_cb example

From: Santtu Lakkala inz at inz.fi
Date: Tue Aug 1 10:00:17 EEST 2006
Brad Burleson wrote:
> My only problem is that gtk_main() transfers control away from my daemon.
> Is it possible to attach to the GLib main loop and return back to my own
> code from time to time (the project I'm working on has it's own internal
> scheduler and I'm not up for a big rewrite now)?

You can do:
g_timeout_add(<milliseconds>, function, user_data);
g_idle_add(function, user_data);
to get regularily back to your code. Note that function should return
TRUE to get called again (and again).

But neither of these is really a good solution. When working with glib,
you should use it's scheduler for things to go smooth.

Santtu Lakkala

More information about the maemo-developers mailing list