[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: idle function parameters
- From: Melvin Hadasht <melvin hadasht free fr>
- To: gtk-app-devel-list gnome org
- Subject: Re: idle function parameters
- Date: Mon, 1 Dec 2003 21:48:11 +0100
> 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));
Did you check the declaration of gtk_idle_add_priority()?
Here it is according to gtk docs:
guint gtk_idle_add_priority( gint priority, GtkFunction function, gpointer data);
where GtkFunction is declared as:
gint (*GtkFunction) (gpointer data).
You glarea_draw is not a GtkFunction, it expects three argumenrs whereas
gtk passes it only the gpointer data as its first argument.
If you need to pass more than one parameter as user_data, use
structures. You can search the archives about how to pass more than
one parameter. It is a FAQ.
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]