Re: gtk_tree_model insertion torment
- From: Kristian Rietveld <kris gtk org>
- To: Samium Gromoff <deepfire ibe miee ru>
- Cc: gtk-app-devel-list <gtk-app-devel-list gnome org>
- Subject: Re: gtk_tree_model insertion torment
- Date: Wed, 27 Aug 2003 18:08:24 +0200
On Tue, 2003-08-26 at 09:11, Samium Gromoff wrote:
I`m currently fighting a terrible inconvenience of the way i operate
with the gtk_tree_model.
For instance i have a tree of objects (my own tree, my own object, have
nothing to do with gtk). I want to visualise it. So let`s say i`m going to insert
one of objects from my tree to the tree model, somewhere deep.
From what i perceive i have to seek through the tree iters from the very root,
gtk_tree_model_get for the key, and strcmp strcmp strcmp.
I assume you are trying to map your tree in a GtkTreeStore, and display
the GtkTreeStore using the GtkTreeView. In that case I would recommend
writing your own GtkTreeModel. This way you don't have to do any
bookkeeping between your tree and the tree in TreeStore.
It`d be a hell much more cool if there could be a constant object, the very
representation of a tree row, to which i`d gladly hold a reference from each node
of my own tree. In this way gtk_tree_model insert is being reduced to nearly nothing.
[That would be GtkTreeRowReference. Though if you have a big tree, you
will have a lot of row references around. This both requires memory and
slows down insertion, deletion and reordering operations. I'd still
recommend to write your own GtkTreeModel, as pointed out above ;)]
Good luck,
-Kris
It`s extremely probable that i`m missing something obvious, though.
regards, Samium Gromoff
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]