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

Re: GTK Signal



hack@altavista.net wrote:
> 
> Hi folks,
> 
> When I was trying to make a gtk_signal_connect (by a button_press_event of a gtk_event_box (!!)), I wasn't able to pass an int to the ButtonPressed function:
> 
> ... GTK_SIGNAL_FUNC (ButtonPressed), (gint) ibutton);

You should pass a pointer as an argument.
Either pass a pointer to that int or cast that int
into a pointer (beware of the size of your int)
Then recover it properly in your handler...

void ButtonPressed (GtkWidget *widget, gpointer ibutton)
int i=(int)ibutton
or
int i=*ibutton

Eric.



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