Re: problems passing data via g_signal_connect



Hi,

<olafandjasper hushmail com> writes:

> g_signal_connect(G_OBJECT (tableCells[r][6]), 
>                  "button_press_event", 
>                  G_CALLBACK (selectActionBin),  
>                  (gpointer) &mydata); 
> 
> 3. The callback function 
> void selectActionBin(MY_DATA *data) 

The correct callback function for this signal would have the following
signature:

void selectActionBin (GtkWidget      *widget,
                      GdkEventButton *event,
                      MY_DATA        *data)

If you want to use the callback as you wrote it, you could use
g_signal_connect_swapped() which will cause the widget and data
pointers to be swapped.


Sven



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