Re: dynamic creation of buttons



"Eric Gillespie, Jr." wrote:
> 
> On Wed, Jan 05, 2000 at 10:02:31PM +0000,
> Peter Allen <P.Allen@pallen.dabsol.co.uk> wrote:
> > Unfortunatly by the time the button has been pressed, button_num
> > is always equal to db->num_buttons-1, so I always get the last entry.
> 
> This is because you're passing the *address* of button_num, so of course
> you're callback is going to see the last value button_num held. 

Why is it different passing the macro GINT_TO_GPOINTER(button_num)
which after the preprocessor has got its hands on it becomes
(void *)buttons_num 
different from &button_num, after all they point to the same thing.
(
typedef void* gpointer;
#define GINT_TO_POINTER(i)      ((gpointer)  (i))
)

btw the example was an example of what was wrong, not what I thought
should be right and wasn't...

Thanks very much for all the help,

			Peter Allen



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