Re: [gtk-list] gpointer and callbacks



(continuation:)

you could also define adjust_level  such:

gint adjust_level(GtkWidget *, GtkEvent *, gpointer)


and call it with 

gtk_signal_connect (GTK_OBJECT (vol_adj), "value_changed",
        GTK_SIGNAL_FUNC (adjust_level), device);
        
 
 as long as you typecast it _before_ using it within adjust_level:
 MIXER_WRITE ((gint)data), 
 
 -------------------------------------------------
 
 I see you're using an "int" for your device;
 the only thing that seems to work with "int"s if you want to  use them
 as pointers is to use the type caster:
 
 
 gtk_signal_connect (GTK_OBJECT (vol_adj), "value_changed",
        GTK_SIGNAL_FUNC (adjust_level), GINT_TO_POINTER(device));
     

Cheers,

Nwanua.
        



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