Re: name -> widget func?



Carlos Pereira <carlos pehoe civil ist utl pt> writes: 
This is from my own code (APP_LAYER is an integer in an enumeration):

gtk_object_set_data (GTK_OBJECT (menu), "select", (gpointer) APP_LAYER);


Should use the GINT_TO_POINTER() and GPOINTER_TO_INT() macros to do
this portably; apparently on some machines you need:

 (gpointer) (glong) my_int       - for conversion to pointer
 (gint) (glong) my_int           - for conversion from pointer

This comes up when sizeof(void*) is larger than sizeof(int) but equal
to sizeof(long).  GINT_TO_POINTER and GPOINTER_TO_INT do the right
thing for the machine.

Havoc




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