idle function parameters



Hi, 
I have the following function:

int glarea_draw (GtkWidget* widget, GdkEventExpose* event, gpointer id)
{
        if (event->count > 0)
        {
                return(TRUE);
        }       

        if (gtk_gl_area_make_current(GTK_GL_AREA(widget)))
        {
                glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
                glLoadIdentity();
                switch (GPOINTER_TO_INT(id)){
                       do stuff
            }
       }
 }

And I use that:

gtk_idle_add_priority (GTK_PRIORITY_REDRAW,glarea_draw, GINT_TO_POINTER(1));

But it doesn't work at all. It compiles but at execution I get a segmentation 
fault. I understand I have to pass the name of the widget as argument, but 
then I can't pass GINT_TO_POINTER(1) any more...
How can I pass both arguments ??
Thanx
Sam
------------------------------------------

Faites un voeu et puis Voila ! www.voila.fr 





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