callback problems



Hi.
        I'm having problems with callbacks on click events on buttons.

I've got a button having a callback connected with:
  gtk_signal_connect_object(GTK_OBJECT(fui->go_button), "clicked",
                            GTK_SIGNAL_FUNC(go_func),
                            (gpointer)fui);
        
Where the callback function is defined as:
void go_func(GtkWidget *widget, gpointer data) {

        /* do some stuff */

}                                                                               And I've hit a very weird bug where consistently the value of 'widget'
is the value 'data' should have, and 'data' contains garbage. Its
consistent enough that I've worked around it by doing:
data = (gpointer)widget;
                
and not using the widget pointer.

Any help/ideas?

--                                                                              
"... I've seen Sun monitors on fire off the side of the multimedia lab.         
I've seen NTU lights glitter in the dark near the Mail Gate.  All these         
things will be lost in time, like the root partition last week.  Time           
to die..." - Peter Gutmann - alt.sysadmin.recovery          



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