[gtkada] Tree_Model equivalent of Clist generic User_Data?

Dmitry A. Kazakov mailbox at dmitry-kazakov.de
Fri Dec 22 10:12:03 CET 2006


On Wed, 20 Dec 2006 11:28:49 -0600, you wrote:

> I am making an effort to learn how to use the tree_model / tree_view widgets
> instead of clist and can't figure out how to attach user data to a row
> (iter).  In clist you could instantiate the generic Row_Data with a user
> data type that could be attached and retreived from a row in the list.
> 
> Is it possible to do this with Tree_Model?
>
> I want to be able to use all of my existing discriminated record structures
> rather than flatten my data structure by creating a column for each (whether
> it is displayed or not).

Yes it is possible. You should create a custom tree model and optionally
custom cell renderers. The model would refer to your Row_Data. The simplest
way is to make it a container of Row_Data. But it also could hold a handle
to DB connection etc. Whether the data are indeed arranged in rows or
columns is up to you. The tree model don't limit representation in any way.
It is just an interface to data, that provides a tabular view of.

Further information and examples you can find here:

   http://www.dmitry-kazakov.de/ada/gtkada_contributions.htm

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



More information about the gtkada mailing list