Re: Idle Function Not Getting Called
- From: Chris Vine <chris cvine freeserve co uk>
- To: Marshall Lake <mlake mlake net>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Idle Function Not Getting Called
- Date: Sat, 5 Sep 2009 10:33:11 +0100
On Fri, 4 Sep 2009 23:12:24 -0400 (EDT)
Marshall Lake <mlake mlake net> wrote:
What stops an idle function from being executed? ... pending events,
right?
I have a situation where an idle function does NOT get called with
the following code:
g_idle_add ((GSourceFunc) idlefunc, NULL);
OR
while (gtk_events_pending ())
gtk_main_iteration ();
g_idle_add ((GSourceFunc) idlefunc, NULL);
[snip]
Assuming there is no coding error in your program which causes an event
in the main loop to block (including a blocking g_idle_add() callback),
use g_idle_add_full() and give the callback a higher priority in the
event queue to put it ahead of the other events.
G_PRIORITY_HIGH will even put it above any GDK drawing functions (not
to be recommended though).
Chris
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]