[Glade-users] glade_xml_signal_autoconnect and manual connection of signals



On Nov 16, 2007 3:51 PM, Giulio Bai <giulio at hewle.com> wrote:
I recently landed to the beautiful world of gtk programming and using
Glade as interface designer I learned quite a lot stuffs.

I always connected signals from my application manually, for example
the event of a button that's been pressed:
...

Well, I tried to make it using the function
glade_xml_signal_autoconnect but I can't figure out how to operate on
other widgets.
Is there any way to access all widgets (such as hello_label) properties
inside object's callback functions?

Can anyone post the same example using the automatic signal connection?

I imagine I didn't catch the most important thing...

First, incase its not working for you at all, you must make sure to
compile your app with symbols exposed (-Wl,--export-dynamic), then, if you
want to pass in a second widget as user_data, you can assign the object
parameter in the signal connection, note that it will also be swapped
(the widget emitting the signal will be userdata and the object parameter
will come first, this is just for historical reasons).

also look into the other libglade signal connecting funcs, the DevHelp
sources are a great example of practical use of libglade.

From looking at your sources, I noticed that you dont g_object_unref()
the GladeXML object, you should do so since it consumes alot of ram
pointlessly (after connecting signals and before entering gtk_main()
would be a good place).

Cheers,
       -Tristan




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