[9299] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

[gtk-list] Re: gpointer and callbacks

daemon@ATHENA.MIT.EDU (Nwanua Elumeze)
Wed Oct 14 16:39:09 1998

Date: Wed, 14 Oct 1998 14:37:40 -0600 (MDT)
From: Nwanua Elumeze <nwanua@makaha.colorado.edu>
To: gtk-list@redhat.com
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com

(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.
        

-- 
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post