[10663] in The GTK GIMP ToolKit mailing list archive
[gtk-list] Re: Signals and callbacks
daemon@ATHENA.MIT.EDU (Andy Kahn)
Thu Dec 3 18:32:48 1998
Date: Thu, 3 Dec 1998 15:23:25 -0500
From: Andy Kahn <kahn@zk3.dec.com>
To: Karl Mitchell <k.l.mitchell@lancaster.ac.uk>
Cc: gtk-list@redhat.com
Reply-To: Andy Kahn <kahn@zk3.dec.com>
In-Reply-To: <3666BA04.AD1797F@lancaster.ac.uk>; from Karl Mitchell on Thu, Dec 03, 1998 at 04:19:16PM +0000
Resent-From: gtk-list@redhat.com
On Thu, Dec 03, 1998 at 04:19:16PM +0000, Karl Mitchell wrote:
> > >
> > > struct _imageData{
> > > GdkImlibImage *image;
> > > GtkWidget *pixmapwidget;
> > > gint magnification_factor;
> > > }
...
> > gtk_signal_connect (GTK_OBJECT (event_box_right), "button_press_event",
> > GTK_SIGNAL_FUNC (magnify_image), (gpointer) &_imageData);
> >
> > replacing _imageData with the name of the variable you want to pass.
> > gpointer is just a void *.
...
>
> That's about it. Thankyou! So how do you access the structure data in the
> magnify_image function? I always seem to get confused when passing pointers
> around the place.
try:
void
magnify_image(GtkWidget *widget, GdkEventButton *event, gpointer cbdata)
{
struct _imageData *imgdata = (struct _imageData *)cbdata;
...
...
rest of your code here.
}
hope this helps,
--andy
--
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null