[Glade-users] libglade oddities...



Keith Minkler wrote:

Is this the correct place to post questions regarding libglade as well?

I'm using glade to build a plug-in interface, and I want the plug ins
to be able to specify certain interface components, such as menus, and
tabs on the main window..

I have the main window all set, but I'd like to be able to have the plug-ins
send the interface to the main app ass glade xml data... however, near as
I can figure (there doesn't seem to be much documentation on libglade at all),
all the glade xml componenets must be read in at once, or else they will not
be part of the GladeXML hashtable..

is there a way to dynamically load glade xml like this into libglade, and
load it into the main GladeXML, which I used to initilise my app?


Yes, I even have a small demo app that demostrates doing this.  In fact
it goes further and loads both the interface *and* the behaviour
independently, dynamically @ runtime using libglade and gmodule. 
Unfortunately I'm at work, and the demo app is at home.  However the
basic approach is:

Create a GladeXML* from a given file, specifying the specific
dialog/container you wish to use.  Note you normally want to set the
windows in the .glade file as invisible and then explictly show them
when you're ready.  Load any required behaviour files using gmodule. 
Either configure the signals manually or call autoconnect (I haven't yet
needed to do this manually, I just call autoconnect myself :).  Extract
any required GtkWidget*'s from the GladeXML.  Set any
widget-data/global/file-static variables you need.

It should just work.

Well at least I haven't had to debug a static-GUI for a while, 'cause
for me it just works :).  [pity application logic can't be this easy.]

Anyway, this is the right list for the question.

For further documentation checkout the libglade reference in
developer.gnome.org.  (you might also want to check the glib doc's in
the same place for more info on gmodule).

Andrae Muys





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