[9307] 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 (Scott Stone)
Wed Oct 14 20:42:33 1998

Date: Thu, 15 Oct 1998 09:42:37 +0900 (JST)
From: Scott Stone <sstone@ume.pht.co.jp>
To: gtk-list@redhat.com
In-Reply-To: <362504B9.F9F07640@melbpc.org.au>
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com

On Wed, 14 Oct 1998, dross wrote:

> 
> 
> I'm trying to write a simple audio interface, and am setting sliders to
> adjust the volume and mic levels. I have a callback function that I would
> like to pass an integer identifier, identifing the device I want to change
> the level for. The problem is I can't seem to pass an integer to this function.
> 
> I am new to gtk and I don't quite understand what a gpointer is, and in all the
> 
> examples I found only strings where used. Can you pass any type using gpointer?

Sure, just typecast the sucker.  gpointer seems to be at least
functionally equivalent to a void *, but better, since you can look at the
contents with gdb and not get 'attempt to dereference void pointer'.

--------------------------------------------------
Scott M. Stone <sstone@pht.com, sstone@turbolinux.com>
               <sstone@pht.co.jp>
Head of TurboLinux Development/Systems Administrator
Pacific HiTech, Inc (USA) / Pacific HiTech, KK (Japan)
http://www.pht.com		http://armadillo.pht.co.jp
http://www.pht.co.jp	        http://www.turbolinux.com


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


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