Idle Function Not Getting Called




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


However, the idle function gets called fine with the following code:

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


What would account for such behavior?

Additionally, in the third code snippet, program flow gets stuck in the while loop until the idle function removes itself by returning FALSE.


--
Marshall Lake -- mlake mlake net -- http://mlake.net



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