GNOME Bugzilla – Bug 145110
Documentation suggestion for Gtk2::TreeView - path strings
Last modified: 2005-02-10 21:04:47 UTC
Path strings (as used by Gtk2::TreePath) are not explained in the perl documentation for gtk2. Here's my notes; the first paragraph is mostly cribbed from the Ruby docs, IIRC. The second paragraph was written by me, and is hopefully true. :) Path strings are expected to be a colon separated list of numbers. For example, the string "10:4:0" would create a path of depth 3 pointing to the 11th child of the root node, the 5th child of that 11th child, and the 1st child of that 5th child. If an invalid path string is passed in, an error results. Usually, in a TreeView, you should be looking at depth 1 or 2 path strings. If your TreeView consists of a single column, then the path string for the cell in the first row is "0", the second row is "1", and so on. A multi-column (but still an ordinary, two-dimensional) TreeView would have "0:0" as the cell in the upper, left-hand corner, "0:1" for the cell to its right, and "1:0" for the cell below it.
Tree paths define only rows, and the number of elements in the path (depth) determines how many parent nodes the row has. For a ListView, the depth will always be 1 because there are no children.
Tree paths are now explained in the POD for Gtk2::TreeModel. Closing.