Re: passing #define'd value to callback
- From: Werner Lehmann <wl bwl uni-kiel de>
- To: gtk-app-devel-list <gtk-app-devel-list gnome org>
- Subject: Re: passing #define'd value to callback
- Date: Tue, 10 Oct 2000 15:21:25 +0200
Peter Wurmsdobler wrote:
If the variable off/on is declared inside the create function,
it works sometimes. However, I would prefer something without
extra declaration of each value passed, like:
The variable gets out of scope and its reserved memory is not
reserved anymore.
gtk_signal_connect(
GTK_OBJECT( mm_off_radiobutton ), "clicked",
GTK_SIGNAL_FUNC( mm_state_radiobutton_clicked ),
&(OFF) );
Any ideas?
void mm_spin_radiobutton_clicked( GtkButton *button, gpointer data )
{
gint state = GPOINTER_TO_INT (data);
...
}
...
gtk_signal_connect(
GTK_OBJECT( mm_off_radiobutton ), "clicked",
GTK_SIGNAL_FUNC( mm_state_radiobutton_clicked ),
GINT_TO_POINTER (OFF) );
Regards,
WL
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]