Re: [gnome-love] gtkbuilder and signals



Patrick Welche a écrit :
In the move from libglade to gtkbuilder, if you pop the following in your
shiny new .ui file:

<object class "GtkAction" id=...
<signal name="activate" handler="my_signal_handler">

and in your code:

gtk_builder_connect_signals(builder_pointer, my_data_pointer);

What does my_signal_handler actually get called as? Allegedly it is
void my_signal_handler(void*), but I get the feeling it's more like

gboolean my_signal_handler(GtkWidget *obj, void *my_data_pointer)

?

How can I find out?
(GtkWidget not GtkAction right? so gtk_action_get_name(obj) isn't going to
get me far?)

Hi Patrick,

Just look at the XML code: the handler my_signal_handler is called for the "activate" signal on a GtkAction object. To know the prototype of the callback, you just need to give a look to the GTK+ documentation, by launching the devhelp application (install it if you didn't), or looking on the online help at
http://library.gnome.org/devel/gtk/stable/

Then, you just search in the help the GtkAction class. Once you're there, you search the "activate" signal. And next to the signal, you have the appropriate callback prototype. Is this case:
http://library.gnome.org/devel/gtk/stable/GtkAction.html#GtkAction-activate

If that was another signal, and you couldnt't find it in the class, you just would have to search this signal upper in the inheritance tree, since it must be inherited from a parent class.

Cheers,
--
Luis




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]