Re: [gtk-list] Re: Signals and callbacks
- From: Karl Mitchell <k l mitchell lancaster ac uk>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] Re: Signals and callbacks
- Date: Thu, 03 Dec 1998 17:07:28 +0000
Rodrigo Moya wrote:
> 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 *.
To elaborate further, I tried the following and it gave an output of 683292. I
felt sure this would work. What have I missed? Please excuse the scrappy
cutting...
-----
void magnify_image( GtkWidget *widget, GdkEventButton *event, gint *data ){
...
g_print("%d", *data)
...
}
int main(int argc, char **argv){
gint *mf;
...
mf =1;
gtk_signal_connect (GTK_OBJECT (event_box_right), "button_press_event",
GTK_SIGNAL_FUNC (magnify_image), (gpointer) &mf);
...
}
-----
Cheers,
-Karl
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-Karl Mitchell=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| Planetary Science Research Group | Secretary, ISPRS WG IV/5 |
| Environmental Sciences Dept. | "Extraterrestrial Mapping" |
| I.E.N.S., Lancaster University | http://www.ge.ucl.ac.uk/isprs-etm |
| Lancaster LA1 4YQ, England, U.K. | tel/fax: +44(0)1524 593975/593985 |
=-=-=-=-=-=-=-=-=-=-=k.l.mitchell@lancaster.ac.uk=-=-=-=-=-=-=-=-=-=-=
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]