Gtk.TreePath - Structures - Gtk 3.0 (original) (raw)
Fields¶
None
Methods¶
class | new () |
---|---|
class | new_first () |
class | new_from_indices (indices) |
class | new_from_string (path) |
append_index (index_) | |
compare (b) | |
copy () | |
down () | |
free () | |
get_depth () | |
get_indices () | |
is_ancestor (descendant) | |
is_descendant (ancestor) | |
next () | |
prepend_index (index_) | |
prev () | |
to_string () | |
up () |
Details¶
class Gtk.TreePath(*args, **kwargs)¶
Returns:
A newly created Gtk.TreePath-struct.
Return type:
Creates a new Gtk.TreePath-struct. This refers to a row.
classmethod new_first()[source]¶
Returns:
A new Gtk.TreePath-struct
Return type:
Creates a new Gtk.TreePath-struct.
The string representation of this path is “0”.
classmethod new_from_indices(indices)[source]¶
Parameters:
indices ([int]) – array of indices
Returns:
A newly created Gtk.TreePath-struct
Return type:
Creates a new path with the given indices array of length.
New in version 3.12.
classmethod new_from_string(path)[source]¶
Parameters:
path (str) – The string representation of a path
Returns:
A newly-created Gtk.TreePath-struct, or None
Return type:
Creates a new Gtk.TreePath-struct initialized to path.
path is 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, None is returned.
Parameters:
index (int) – the index
Appends a new index to a path.
As a result, the depth of the path is increased.
Parameters:
b (Gtk.TreePath) – a Gtk.TreePath-struct to compare with
Returns:
the relative positions of self and b
Return type:
Compares two paths.
If self appears before b in a tree, then -1 is returned. If b appears before self, then 1 is returned. If the two nodes are equal, then 0 is returned.
Returns:
a new Gtk.TreePath-struct
Return type:
Creates a new Gtk.TreePath-struct as a copy of self.
Moves self to point to the first child of the current path.
Frees self. If self is None, it simply returns.
Returns:
The depth of self
Return type:
Returns the current depth of self.
Returns:
The current indices, or None
Return type:
[int]
Returns the current indices of self.
This is an array of integers, each representing a node in a tree. It also returns the number of elements in the array. The array should not be freed.
New in version 3.0.
is_ancestor(descendant)[source]¶
Parameters:
descendant (Gtk.TreePath) – another Gtk.TreePath-struct
Returns:
True if descendant is contained inside self
Return type:
Returns True if descendant is a descendant of self.
is_descendant(ancestor)[source]¶
Parameters:
ancestor (Gtk.TreePath) – another Gtk.TreePath-struct
Returns:
True if ancestor contains self somewhere below it
Return type:
Returns True if self is a descendant of ancestor.
Moves the self to point to the next node at the current depth.
prepend_index(index_)[source]¶
Parameters:
index (int) – the index
Prepends a new index to a path.
As a result, the depth of the path is increased.
Returns:
True if self has a previous node, and the move was made
Return type:
Moves the self to point to the previous node at the current depth, if it exists.
Returns:
A newly-allocated string. Must be freed with GLib.free().
Return type:
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.
Returns:
True if self has a parent, and the move was made
Return type:
Moves the self to point to its parent node, if it has a parent.