[Glade-users] Large Glade XML vs Multiple Small Glade XML



On Sun, Oct 26, 2008 at 9:02 AM, BalaKrishna Kolluru
<balakkvj at dcs.shef.ac.uk> wrote:


2008/10/26 James <proglottis at nothing.co.nz>

Hey,
So I've been looking around a few of the projects that use Glade3 and
have been developing a few small projects myself.

I'm wondering, is it best to have a single large all encompassing glade
file or many small glade files, say one per dialog. I guess ultimately
I'm interested in finding out what best practices are for using Glade3
especially for multiple dialogs.

Currently I'm wrapping each dialog in its own class and using XML
builder to load the dialog in that class. Such that every dialog class
creates a new instance of XML builder and loads what it needs from a
single large XML file. This is obviously going to be less efficient if
the XML files aren't cached.

I hope no-one has asked this before. I had a quick search of the
mailing-list archives, but couldn't find anything.

If your concerns are performance in a possibly graphical intensive
UI, you should probably be using one GtkBuilder at startup time
and keeping the widget hierarchy in ram - if thats not possible
(too big UI too little ram), then cut your UI in sections
(i.e. load the whole "bookkeeping" interface when the user enters
that universe, and destroy it upon exit).

In the above performance critical scenario, using multiple glade files
might be a performance hit at startup time, but I think its
probably a small/negligable difference (but still let me know
if you find dramatic differences ;-D).

Cheers,
                     -Tristan




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