Re: [gtk-list] Re: Signals and callbacks
- From: Andy Kahn <kahn zk3 dec com>
- To: Karl Mitchell <k l mitchell lancaster ac uk>
- Cc: gtk-list redhat com
- Subject: Re: [gtk-list] Re: Signals and callbacks
- Date: Thu, 3 Dec 1998 15:23:25 -0500
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]