RE: variables in g_signal_connect



use GINT_TO_POINTER:

Horizontal_Zoom_In_clicked(GtkWidget *widget, gpointer gt)
g_signal_connect ((gpointer) Horizontal_Zoom_In, "clicked",
                                   G_CALLBACK
(Horizontal_Zoom_In_clicked), GINT_TO_POINTER(graph_type));

and GPOINTER_TO_INT(gt) in the callback to get the int value from the
pointer.

see also

http://developer.gnome.org/doc/API/2.0/glib/glib-Type-Conversion-Macros.html

gyozo

-- 
When you're not looking at it, this fortune is written in FORTRAN.



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