In Gtk, what's the difference between TreePath and TreeIter?

I learned to use TreeView s, and these two types are often used to access a specific row of a tree. I do not quite understand the difference between the two. My code works - I convert back and forth between them based on the required parameters, but not on the basis of a real understanding of the reasons.

What is the difference between these two types?

+4
source share
1 answer

A detailed explanation of this here is from the Gtk people. Essentially, TreePath is a way of describing the logical position of a string in a model. For example, TreePath "5: 3: 2" means:

  • look at the children of the sixth [5] node at this level; that
  • look at the children of the fourth [3] node at this level; that
  • look at the third [2] node at this level

This describes exactly one node, after which you drill each level of the tree.

For comparison, a TreeIter is a more direct reference to the node in question, rather as a pointer to a specific node.

+6
source

Source: https://habr.com/ru/post/1301171/


All Articles