[gtkada] Custom Tree_Model Implementation

Marc A. Criley m.criley at earthlink.net
Wed Jan 7 22:14:32 CET 2004


The Tree_Store and List_Store models are actually considered to be part of
Gtk itself, rather than GtkAda.

I've read statements along the lines of "building your own tree model
subclass isn't too hard, but the provided list and tree store models can
probably meet the needs of most applications."  As I'm in the midst of
transitioning a GtkAda application to use those models, I can vouch for that
recommendation.  I use both List_Store and Tree_Store instances, and I've
actually found that these models are somewhat surprisingly utilitarian.
Once you grasp the concept of real and virtual columns, and renderers, they
turn out to be quite powerful and useful constructs.  (I do wish, though,
that there were more standard renderers, such as combo boxes and popup
menus.)

I know you'd like to use your Booch structures as the data model, and I
truly wish you good luck if you want to stick with that, but if it's not
that critical, consider making more use of the "stores" as a simple data
base.  It's working very well for me.

Marc A. Criley
McKae Technologies
www.mckae.com
The Efficient Production of High Quality Software

-----Original Message-----
From: gtkada-admin at lists.act-europe.fr
[mailto:gtkada-admin at lists.act-europe.fr]On Behalf Of Andreas Mack
Sent: Wednesday, January 07, 2004 2:03 PM
To: gtkada at lists.act-europe.fr
Subject: [gtkada] Custom Tree_Model Implementation

I'm teaching myself Ada and so far it has been a real pleasure. I wrote
a small text manipulation program using the Boochs components. Now
I would like to write GUI for it and looked at GtkAda. Small testing
programs work, but the problem now is to get my boochs collection
to be the Tree_Model for a Tree_View. I searched the net for
custom Tree_Models for GtkAda to study them, but I haven't found any.
The implementations supplied with GtkAda (Tree_Store, List_Store)
seem to call only C code. Are there any examples of custom tree/list
models around, no matter how small and simple? How do I "fill" Gtk
interfaces in Ada?





More information about the gtkada mailing list