Re: [gtk-list] Re: ItemFactory anyone?



On Thu, Jan 14, 1999 at 07:03:33PM +0100, Jan Kratochvil wrote:
...
> > So I suppose if you have some data you want to associate with a menu item
> > you can pass in an array or gslist as the callback_data.  Then in your
> > callback function retrieve the data item you want by indexing into the array
> > or gslist using the passed in callback_action integer.
> > 
> > If you already know what the menu items are going to be and they won't
> > change at runtime you can just use a case statement in your callback.
> 
>   Oh my god, why just don't cast the needed pointer (it WILL be probably pointer),
> to "guint"? Like in the following example:
> 

a pointer is a datatype, just like an integer or character.
you can't assume that types have the same size.  on a 64-bit
platform, casting a pointer (which is 64 bits) to an integer
(which is 32 bits) will fail.
--andy



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