Re: Idle Function Not Getting Called

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, 

I have a situation where an idle function does NOT get called with
the following code:

     g_idle_add ((GSourceFunc) idlefunc, NULL);


     while (gtk_events_pending ())
         gtk_main_iteration ();
     g_idle_add ((GSourceFunc) idlefunc, NULL);


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).


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