Re: [gtk-list] gpointer and callbacks



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




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