TreePath#
Deprecated since version 4.10: Please do not use it in newly written code
- class TreePath(*args, **kwargs)#
An opaque structure representing a path to a row in a model.
Constructors#
- class TreePath
- classmethod new() TreePath#
Creates a new
GtkTreePathThis refers to a row.Deprecated since version 4.10: Please do not use it in newly written code
- classmethod new_first() TreePath#
Creates a new
GtkTreePath.The string representation of this path is “0”.
Deprecated since version 4.10: Please do not use it in newly written code
- classmethod new_from_indices(indices: list[int]) TreePath#
Creates a new path with
first_indexandvarargsas indices.Deprecated since version 4.10: Please do not use it in newly written code
- Parameters:
indices
- classmethod new_from_string(path: str) TreePath | None#
Creates a new
GtkTreePathinitialized topath.pathis 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,Noneis returned.Deprecated since version 4.10: Please do not use it in newly written code
- Parameters:
path – The string representation of a path
Methods#
- class TreePath
- append_index(index_: int) None#
Appends a new index to a path.
As a result, the depth of the path is increased.
Deprecated since version 4.10: Please do not use it in newly written code
- Parameters:
index – the index
- compare(b: TreePath) int#
Compares two paths.
If
aappears beforebin a tree, then -1 is returned. Ifbappears beforea, then 1 is returned. If the two nodes are equal, then 0 is returned.Deprecated since version 4.10: Please do not use it in newly written code
- Parameters:
b – a
GtkTreePathto compare with
- down() None#
Moves
pathto point to the first child of the current path.Deprecated since version 4.10: Please do not use it in newly written code
- free() None#
Frees
path. IfpathisNone, it simply returns.Deprecated since version 4.10: Please do not use it in newly written code
- get_depth() int#
Returns the current depth of
path.Deprecated since version 4.10: Please do not use it in newly written code
- get_indices() list[int] | None#
Returns the current indices of
path.This is an array of integers, each representing a node in a tree. This value should not be freed.
The length of the array can be obtained with
get_depth().Deprecated since version 4.10: Please do not use it in newly written code
- is_ancestor(descendant: TreePath) bool#
Returns
Trueifdescendantis a descendant ofpath.Deprecated since version 4.10: Please do not use it in newly written code
- Parameters:
descendant – another
GtkTreePath
- is_descendant(ancestor: TreePath) bool#
Returns
Trueifpathis a descendant ofancestor.Deprecated since version 4.10: Please do not use it in newly written code
- Parameters:
ancestor – another
GtkTreePath
- next() None#
Moves the
pathto point to the next node at the current depth.Deprecated since version 4.10: Please do not use it in newly written code
- prepend_index(index_: int) None#
Prepends a new index to a path.
As a result, the depth of the path is increased.
Deprecated since version 4.10: Please do not use it in newly written code
- Parameters:
index – the index
- prev() bool#
Moves the
pathto point to the previous node at the current depth, if it exists.Deprecated since version 4.10: Please do not use it in newly written code
- to_string() str | None#
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. If the path has depth 0,
Noneis returned.Deprecated since version 4.10: Please do not use it in newly written code