[pygtk] GtkBuilder and large files

Gerald Britton gerald.britton at gmail.com
Sat May 2 01:55:40 WST 2009


I ran into this interesting discussion that pertains to my situation
of converting from libglade to GtkBuilder:

http://mail.gnome.org/archives/gtk-devel-list/2007-June/msg00313.html

I'm not sure if this discussion was ever resolved, but there are at
least two questions in it that interest me greatly:

1. does GtkBuilder cache the files it reads to save work on future
add_from_file calls?

2. What are the performance implications of having one big glade file
per application (maybe with scores of toplevels in it) versus one
toplevel per file or perhaps one glade file with a few toplevels per
functional area?

In my application, I have one big glade file (38 top levels at the
moment).  I'm concerned about the performance of rereading and
reparsing this file every time it is used by add_from_file (at the
moment I call this function from 40 separate places).  I'm prepared to
work on splitting it up by functional area, depending on the answers
to the questions above.

The other surprise in converting from libglade to GtkBuilder is, as
previously disussed, that libglade apparently has a hierarchical
namespace while GtkBuilder apparently has a flat one.  This is an
issue with multiple toplevels where they have children with the same
name(s).  I submitted a bug report on that already:

http://bugzilla.gnome.org/show_bug.cgi?id=579345




-- 
Gerald Britton


More information about the pygtk mailing list