glib - main event loop

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

 



How to get idle event source called in main event loop? I do the following:
my idle function is:

static gboolean
idle ( gpointer data )
{
    g_print ( "Idle called\n" );
    if ( counter1 == 0 && counter2 == 0 )
    {
        g_main_loop_quit ( ( GMainLoop * ) data );
        return FALSE;
    }
    else
        return TRUE;
}

The variables counter1 and counter2 reach 0 after some time of execution.

I add this source this way:

    g_idle_add ( idle, mlp );

where

    GMainLoop *mlp;

is loop which is run.

Even if all sources end with G_SOURCE_REMOVE the idle source is never called.

--
Regards
Krzysztof J.

_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list



[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux