[gtkada] Using libglade2 with GtkAda 2.0.0

Preben Randhol randhol at pvv.org
Sun Feb 16 11:58:21 CET 2003


Ludovic Brenta <ludovic.brenta at insalien.org> wrote on 15/02/2003 (15:37) :
> Hello,
> 
> I attended Mark Owen's presentation on GTK+ at the FOSDEM last
> week-end.  The presentation was about the basics of programming with the
> GTK.  Mark is the maintainer of the GTK packages in Red Hat Linux, and
> develops some of Red Hat's configuration GUIs using GTK).  He said two
> things that I found interesting:
> 
> 1) Do not program in C.
> 
> Rationale: well, you know.  The inherent unsafely of C, memory
> management, pointers.  At Red Hat, they've chosen Python as their
> language for application development (as opposed to library development,
> for which Mark said C was fine).  I choose Ada :)

Yes the continued programming in C will be a big problem in the future.

> 2) Do not generate source code from glade; use libglade instead.
> 
> The reasons he gave for this are that the code generators for various
> languages, even C, are less well tested than libglade.  In particular,
> the diff-and-patch based method of altering the generated files is
> error-prone.  He also said that the performance hit of loading the XML
> file and constructing the GUI at run-time is mostly a myth, as it is
> negligible.

However what he failed to recognise is the strenghts in the Ada
language.  I mean you will loose the tests done by the compiler when not
compiling the GUI. For example how do you ensure that the callbacks work
propperly? How do you make your own composite widgets etc... I can agree
with the problems you may encounter when you change the layout of the
GUI, but I don't want to loose the static strengths of Ada.

This is also why I always hand-edit the GUI code a bit after generating
it. Mostly it is to copy the body into my package, AND removing the

   pragma Suppress (All_Checks);

which I don't think should be put in there by gate in the first place.
At least it should be configurable.

-- 
Preben Randhol ------------------- http://www.pvv.org/~randhol/ --
                 «For me, Ada95 puts back the joy in programming.»



More information about the gtkada mailing list