RE: [gtk-list] Casting gints to gpointers - Was: Re: Getting checkbutton's label




> I'd probably just cast the integer values to void pointers and then back
> in the callback...

I hope everyone is aware of the macros available to do this (in glib.h):

   GPOINTER_TO_INT, GINT_TO_POINTER
   GPOINTER_TO_UINT, GUINT_TO_POINTER

e.g. instead of:
	index = (gint) selection->data;
use:
	index = GPOINTER_TO_INT(selection->data);

These were sneaked into GTK 1.0.2, to avoid problems compiling code
on Alphas I believe. (Please correct me if I'm wrong.)

Damon




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