A path refers to a single row in a
TreeModel
(such as a
ListStore
or a
TreeStore
). In this respect, it is similar
to a
TreeIter
, however a path also contains details of the
structure of the tree (TreeIter is a generic object for the entire TreeView
family, including flat lists and tables.)
appendIndex
public void appendIndex(int index)
Appends a new index to the path. As a result, the depth of the
path is increased
index
-
compare
public int compare(TreePath other)
Compares the path with another path. If the other path appears before this
one in a tree, then -1 is returned. If this one appears before the other,
then 1 is returned. If the two nodes are equal, then 0 is returned.
down
public void down()
Moves path to point to the first child of the current path.
getDepth
public int getDepth()
Returns the current depth of path.
getIndices
public int[] getIndices()
Returns the current indices of the path.
- An array of ints, each representing a node in the tree.
gtk_tree_path_append_index
protected static final void gtk_tree_path_append_index(Handle path,
int index)
gtk_tree_path_compare
protected static final int gtk_tree_path_compare(Handle a,
Handle b)
gtk_tree_path_down
protected static final void gtk_tree_path_down(Handle path)
gtk_tree_path_get_depth
protected static final int gtk_tree_path_get_depth(Handle path)
gtk_tree_path_get_indices
protected static final int[] gtk_tree_path_get_indices(Handle path)
gtk_tree_path_is_ancestor
protected static final boolean gtk_tree_path_is_ancestor(Handle path,
Handle descendant)
gtk_tree_path_is_descendant
protected static final boolean gtk_tree_path_is_descendant(Handle path,
Handle ancestor)
gtk_tree_path_new
protected static final Handle gtk_tree_path_new()
gtk_tree_path_new_first
protected static final Handle gtk_tree_path_new_first()
gtk_tree_path_new_from_string
protected static final Handle gtk_tree_path_new_from_string(String path)
gtk_tree_path_next
protected static final void gtk_tree_path_next(Handle path)
gtk_tree_path_prepend_index
protected static final void gtk_tree_path_prepend_index(Handle path,
int index)
gtk_tree_path_prev
protected static final boolean gtk_tree_path_prev(Handle path)
gtk_tree_path_to_string
protected static final String gtk_tree_path_to_string(Handle path)
gtk_tree_path_up
protected static final boolean gtk_tree_path_up(Handle path)
isAncestor
public boolean isAncestor(TreePath descendant)
Returns TRUE if descendant is a descendant of path.
descendant
- Another TreePath
- TRUE if descendant is contained inside path
isDescendant
public boolean isDescendant(TreePath ancestor)
Returns TRUE if path is a descendant of ancestor.
ancestor
- Another TreePath
- TRUE if ancestor contains path somewhere below it
next
public void next()
Moves the path to point to the next node at the current depth.
prependIndex
public void prependIndex(int index)
Prepends a new index to the path. As a result, the depth of the
path is increased
index
-
previous
public boolean previous()
Moves the path to point to the previous node at the current depth, if it
exists.
- TRUE if path has a previous node, and the move was made.
toString
public String toString()
Generates a string representation of the path. This string is a ':'
separated list of numbers. For example, "4:10:0:3" would be an
acceptable return value for this string.
- String representation of the path.
up
public boolean up()
Moves the path to point to it's parent node, if it has a parent.
- TRUE if path has a parent, and the move was made.