Re: Custom TreeModel



Dave Howorth <dhoworth mrc-lmb cam ac uk> writes:

It emphasises the
distinction between a path and an iter better to my eyes.

I think the original makes it hard to understand the difference between
a path and an iter.  You wonder why both exist.  May try to work in that
to use a path the model may chase down a tree and perhaps along a linked
list (the original ListStore was a linked list), whereas an iter is like
a pointer for direct access.

Oh, and the bit about 0 being the root node was dodgy, as there's no
single root node, but a set of toplevel rows.  (Wording copied in from
the gtk docs ...)

This is what I'm not clear about. Does iters-persist cause this change
or not?

Yes.  In as much as a model which announces itself as having that flag
has that property ...

If it does then the text under Creating a Custom Tree Model/Tree
Iters also needs some text explaining what is required.

It should be only a matter of how you cook up iter contents to satisfy
the interface ... maybe a cross reference though.

If not then the
original warning about differences from gtk+ needs reinstating.

There shouldn't be any differences, beyond the boxed object lifespan.
The equivalent of that in C is how long you're allowed to hang onto a
pointer passed to you in a signal callback ... ie. who owns the space
pointed to and how long it's good.

"Glib::Boxed is a generic wrapper mechanism for arbitrary C structures.

A copy of the Glib::Boxed docs?  Shouldn't need to replicate it.
Similar appears under "Memory Handling" in Gtk2::api too, which is a
slightly tricky place to find it.  Perhaps the gory details should be
under Glib::Boxed and cross references from elsewhere.



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