[Glade-users] Libglade Tutorial
Keith Sharp
kms@passback.co.uk
Mon, 16 Feb 2004 16:59:44 +0000
On Sun, 2004-02-15 at 22:42, Reginald Johnson wrote:
> Can somebody point me to a good libglade tutorial. I'm specifically
> looking for the "proper" way to lookup widgets in a callback function.
> for example my "main" function looks like this:
[ snip code ]
Generally what I do is create a G-Object or a struct to contain all of
the information about an application. I then have an initialise
function that loads and populates this struct or object.
I tend to connect the signals and signal handlers by hand so that I can
pass a pointer to my application object as the final argument to
g_signal_connect.
I don't know of any libglade tutorial that explains this. I first saw
this design pattern in Gossip[1]. I found the source code for Gossip to
be very clean and easy to understand. I would recommend that you look
at the source code, in particular gossip-main.c and gossip-app.[ch].
Keith.
[1] http://gossip.imendio.org/