Re: advice on coding techniques

y g <odysseus lost gmail com> wrote:

I am asking for advice on coding techniques using gtk and libglade. Is
it better to have each window as a seperate glade xml file or code
them directly to gtk? And mix up of the two should be avoided or it
does not have any side effects?

Larger Glade XML files may cause significant loss of performance when
being accessed at runtime via libglade. While it is certainly not
necessary to put every simple dialog with just 5 to 10 widgets into its
own XML file, splitting it up when it comes to a number of dialogs with
more than 20 widgets may be reasonable, to avoid performance penalties.

Other than oerformance I see no reason to split Glade XML files. If
using Glade C code instead of libglade (like we do), splitting the GUI
definitions of an application into several XML files is neither
necessary nor really an option. There is no performance penalty for the
running application at all when using Glade C code instead of libglade,
as there isn't any expensive XML parsing at runtime. Unfortunately there
is resistance against keeping this concept for future versions of Glade.

I don't think structural beauty alone is a good reason to split Glade
XML files. I can also say that having multiple persons working on the
GUI doesn't require split portions, either. So my advice is to split the
XML files only if you have indications of loss of performance due to
libglade. Good performance considerations include regards of machines
slower than yours, down to at least 1/5th the speed of current top CPUs.

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