I've been learning to use TreeView
s, and these two types are often used for accessing a particular row of a tree. I don't really understand the difference between the two. My code is working--I convert back and forth between the two based on a function's required parameters--but not based on any real understanding of why.
What is the difference between these two types?
There's a detailed explanation of this here from the Gtk folks. Essentially, a TreePath
is a way to describe the logical position of a row in the model. For example, the TreePath
"5:3:2" means:
This exactly describes the one node you're after by drilling through each tree level.
By comparison, a TreeIter
is a more direct reference to the node in question, more like a pointer to a specific node.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With