I\'m trying to learn how to make GUIs using gtk+ 3.0. I want to pass a simple argument, an integer, to a callback function, so that when I press the button the value of the
There are a bunch of useful macros which store an integer (32bit, no longer!) into a pointer.
int a = 42; gpointer ptr = GINT_TO_POINTER (a) //GUINT_TO_POINTER (a), GBOOLEAN_TO_POINTER (a), GSIZE_TO_POINTER (a)
reverse:
int a2 = GPOINTER_TO_INT (ptr); //GPOINTER_TO_UINT (ptr), GPOINTER_TO_...