Gnome::Gtk4::N-TreePath
Description
An opaque structure representing a path to a row in a model.
Class initialization
Note: The native version of this class is deprecated in gtk4-lib() since version 4.10
new
:native-object
Create an object using a native object from elsewhere. See also Gnome::N::TopLevelSupportClass.
multi method new ( N-Object :$native-object! )
new-treepath
Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10
Creates a new Gnome::Gtk4::N-TreePath This refers to a row.
method new-treepath ( --> Gnome::Gtk4::TreePath \)
new-first
Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10
Creates a new Gnome::Gtk4::N-TreePath.
The string representation of this path is “0”.
method new-first ( --> Gnome::Gtk4::TreePath \)
new-from-indices This function is not yet available
Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10
Creates a new path with $first-index
and $varargs
as indices.
method new-from-indices ( Int() $first-index, … --> Gnome::Gtk4::TreePath \)
$first-index; first integer.
…; …. Note that each argument must be specified as a type followed by its value!
new-from-indicesv
Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10
Creates a new path with the given $indices
array of $length
.
method new-from-indicesv ( Array[Int] $indices, Int() $length --> Gnome::Gtk4::TreePath \)
$indices; array of indices.
$length; length of
$indices
array.
new-from-string
Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10
Creates a new Gnome::Gtk4::N-TreePath 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, undefined is returned.
method new-from-string ( Str $path --> Gnome::Gtk4::TreePath \)
$path; The string representation of a path.
Methods
append-index
Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10
Appends a new index to a path.
As a result, the depth of the path is increased.
method append-index ( Int() $index )
$index; the index.
compare
Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10
Compares two paths.
If $a
appears before $b
in a tree, then -1 is returned. If $b
appears before $a
, then 1 is returned. If the two nodes are equal, then 0 is returned.
method compare ( N-Object $b --> Int )
$b; a Gnome::Gtk4::N-TreePath to compare with
Return value; the relative positions of $a
and $b
.
copy
Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10
Creates a new Gnome::Gtk4::N-TreePath as a copy of $path
.
method copy (--> N-Object )
Return value; a new Gnome::Gtk4::N-TreePath.
down
Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10
Moves $path
to point to the first child of the current path.
method down ( )
free
Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10
Frees $path
. If $path
is undefined, it simply returns.
method free ( )
get-depth
Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10
Returns the current depth of $path
.
method get-depth (--> Int )
Return value; The depth of $path
.
get-indices
Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10
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()
.
method get-indices (--> Array[Int] )
Return value; The current indices.
get-indices-with-depth
Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10
Returns the current indices of $path
.
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.
method get-indices-with-depth ( Array[Int] $depth --> Array[Int] )
$depth; (transfer ownership: full) return location for number of elements returned in the integer array.
Return value; The current indices.
is-ancestor
Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10
Returns True
if $descendant
is a descendant of $path
.
method is-ancestor ( N-Object $descendant --> Bool )
$descendant; another Gnome::Gtk4::N-TreePath
Return value; True
if $descendant
is contained inside $path
.
is-descendant
Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10
Returns True
if $path
is a descendant of $ancestor
.
method is-descendant ( N-Object $ancestor --> Bool )
$ancestor; another Gnome::Gtk4::N-TreePath
Return value; True
if $ancestor
contains $path
somewhere below it.
next
Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10
Moves the $path
to point to the next node at the current depth.
method next ( )
prepend-index
Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10
Prepends a new index to a path.
As a result, the depth of the path is increased.
method prepend-index ( Int() $index )
$index; the index.
prev
Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10
Moves the $path
to point to the previous node at the current depth, if it exists.
method prev (--> Bool )
Return value; True
if $path
has a previous node, and the move was made.
to-string
Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10
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, undefined is returned.
method to-string (--> Str )
Return value; A newly-allocated string.
up
Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10
Moves the $path
to point to its parent node, if it has a parent.
method up (--> Bool )
Return value; True
if $path
has a parent, and the move was made.