Re: [gtk-list] Re: Signals and callbacks
- From: "Rodrigo Moya" <Moya_Rodrigo/madrid_tecnologia sinvest es>
- To: <gtk-list redhat com>
- Subject: Re: [gtk-list] Re: Signals and callbacks
- Date: Fri, 4 Dec 1998 10:38:35 +0100
>> >
>> If what you mean is how to pass this data to the callback, you should
>> replace the above function line with:
>>
>> 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 *.
>>
>> I hope this was what you were asking.
>
>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.
>
Well, you access it by casting the gpointer parameter in your callback:
struct _imageData *data = (struct _imageData *) gpointer_parameter;
and that's all
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]