[Glade-users] function pointers and signals

Tristan Van Berkom tvb at gnome.org
Sun Dec 17 13:29:37 EST 2006


antonio giulio wrote:

>Hi,
>
>using glade-GUI I have added a signal for a button. In "Object" field
>I want to insert a function-pointer for a generic function:
>
>void on_button_clicked(GtkButton * button, gpointer user_data)
>{
>	...
>	void (* func) (gint) = user_data;
>        ...
>}
>
>but in run-time I got "user_data = 0x0".
>
>Is it possible past in Glade-GUI a function pointer?
>  
>
No currently its not possible to get a function
pointer as user-data when defining the signal
in glade, it could be possible to resolve a user
defined string using dlsym(), effectively passing
any globally visible symbol's pointer into the
user_data argument.

This patch to libglade already does it:
http://bugzilla.gnome.org/show_bug.cgi?id=161903

But the future of glade is in the builder, so
I'd suggest you make an RFE for that on this bug:
   http://bugzilla.gnome.org/show_bug.cgi?id=172535
(maybe it will help to grease the wheel :D)

Cheers,
                            -Tristan



More information about the Glade-users mailing list