- From: Chris Vine <chris cvine freeserve co uk>
- To: gtkmm-list gnome org
- Subject: Re: TreeModelColumn
- Date: Sun, 23 Oct 2005 12:58:00 +0100
On Saturday 22 October 2005 00:38, Marcelo David wrote:
> I want to create a dinamic TreeView, then I dont know how many columns I'll
> I need another way for get and set values to the columns where I can to
> reference a column with an index value (or number of column). In another
> words I need to declarate TreeModelColumns to ColumnRecord at runtime and
> I'll have an index to referenciate to columns for get and set methods.
You have to know the number of tree model columns (storage data points) when
creating the tree model (and the type of each tree model column). In your
case the tree model columns could represent the maximum number of columns you
might want to display. You connect the Gtk::TreeModel columns to the
Gtk::TreeView columns dynamically anyway, with
Gtk::TreeView::append_column(), so just don't connect up the tree model
columns you don't want displayed (they will then be hidden).
Tree models are just structured data points, which you can display with a tree
view. You don't in fact have to display any or all of the tree model columns
if you choose not to do so. If you think of them that way then it should be
Incidentally you can sort on a hidden tree model column - that is quite a
common use of them.
] [Thread Prev