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: Thu, 3 Dec 1998 16:47:35 +0100
Hi!
>Secondly, signals and callbacks. I'm trying to implement a simple zoom
routine
>for each image, activated whenever the event box holding the image is
clicked,
>at present using:
>
> gtk_signal_connect (GTK_OBJECT (event_box_right), "button_press_event",
> GTK_SIGNAL_FUNC (magnify_image), NULL);
>
>However, the magnify_image function needs quite a lot of information passed
to
>it:
>
> struct _imageData{
> GdkImlibImage *image;
> GtkWidget *pixmapwidget;
> gint magnification_factor;
> }
>
>, and for the life of me I can't work out how to do it. I think it's
something
>to do with my lack of understanding of gpointers. Could anyone help me work
>this one out?
>
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.
Cheers
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]