[Glade-devel] Embedding glade in other applications (like IDE )



On Thu, 2004-01-08 at 16:54, Damon Chaplin wrote:
On Wed, 2004-01-07 at 17:37, Paolo Borelli wrote:

Note however that generating code is a _bad_ idea also with the current
glade-2 and it is strongly discouraged.

I think for large projects with multiple developers libglade is probably
a better idea (though I think you can work around the problems with
generated code if you need to).

But for small projects I don't think it really matters too much. Lots of
people have built apps using generated code.

One current advantage of generated code is that you can just click on
'Build' and you get a complete app ready to compile and run.


Yeah I know... I've used code generation myself the first times I tried
glade. It's just that after the 100th time that you hear various "Hacker
Gods" flame code generation on #gtk+ you get used to it and start to do
the same :-)

Beside there's a difference between _choosing_ code generation and just
use it because you never even *tried* libglade.


Anyway the point I was making was also that code generation it's better
done outside of glade, processing the xml file with other tools so that
you can output in any language and that more complicated templates can
be integrated in an IDE etc


There are also other issues with libglade that need resolving:

 o libglade works best if you keep each window in a separate XML file,
   but Glade is currently oriented to keeping all windows in one file.
   (Glade-3 is probably the same.)

 o signal connection, which I just mentioned in another mail.
   This has to be done automatically to be used in a decent IDE,
   where you will also be able to type in signal handler code.
   Why did you suggest doing it manually, Paolo?


Well... actually I don't know... it's just that most of the gnome apps
I've seen heavily use glade+libglade, but really few also use the signal
stuff. Some of the possible reasons may be:

* the ui in glade for adding signals is a bit unconfortable.
* there is not so much to gain, after all you have to code the callback
anyway.
* it often happens to add/remove/change signlas and callbacks during
developement while the UI is already done, and it's more confortable
change a line in the code than fire up glade.
* you often have other GObjects with their signals etc so you may want
to keep a consistent style wrt signals and callbacks.
* I got the impression (but I may be totally wrong) that callbacks in
libglade should be global while I usually like to keep them local to the
file with the "static" keyword


 o I'm still not quite sure about memory management issues in libglade.
   e.g. the glade_xml_new() docs say that the parse tree is cached,
   and indeed the GladeInterface is kept around. But I can't see where
   that is reused. Where is that code? Is it possible to clear the
   cache?

   Also, if I call glade_xml_new() with no root node, does that mean
   that one instance of every window is created. That could lead to
   wasted resources, since many windows may not be needed.

Damon



ciao
        paolo





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