Re: GtkTreeStore manipulation



Tristan Van Berkom wrote:
On Wed, 17 Nov 2004 15:38:47 -0500, Tristan Van Berkom
<tristan van berkom gmail com> wrote:
[....]

Ok guys, sorry for my ultra spam on the treeview subject.

I finally have a fix that works for glade-3... the context is a GtkTreeStore
which represents a widget hierarchy, so the problem was that I can not
garauntee that parents get added to the tree before children, so when parents finally get added, we have to adjust the tree.

Right now, when a parent gets added to the tree, all the GtkTreeIter's that
are "children" of that widget get removed and re-added to the project.

While this solution is "sane" and "works", it still leaves me confused as to
why I wouldn't be able to reparent heirarchies of GtkTreeIter objects in a GtkTreeStore, I would expect that a file browser would come across the
same situation when a "mv" of a directory occurs, should the file browser
have to completely recreate the hierarchy of the treeview ?

It might be easier to write your own implementation of the GtkTreeModel interface than to use the general-purpose GtkTreeStore. This may remove the need to maintain what amounts to two separate models, one in the GtkTreeStore and one in the widget hierachy that you are displaying. Instead, a custom tree-model implementation could get it's data directly from the widget hierachy.

If you want, I'll have a go at writing the custom tree model for you.

--
Tim Evans
Applied Research Associates NZ
http://www.aranz.com/



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