About all my projects
Gnome::Gtk4::N-TreeRowReference

Gnome::Gtk4::N-TreeRowReference

Description

A GtkTreeRowReference tracks model changes so that it always refers to the same row (a Gnome::Gtk4::N-TreePath refers to a position, not a fixed row). Create a new GtkTreeRowReference with .new-treerowreference().

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-treerowreference

Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10

Creates a row reference based on $path.

This reference will keep pointing to the node pointed to by $path, so long as it exists. Any changes that occur on $model are propagated, and the path is updated appropriately. If $path isn’t a valid path in $model, then undefined is returned.

method new-treerowreference ( N-Object() $model, N-Object $path --> Gnome::Gtk4::TreeRowReference \)
  • $model; a Gnome::Gtk4::R-TreeModel.

  • $path; a valid Gnome::Gtk4::N-TreePath to monitor

new-proxy

Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10

You do not need to use this function.

Creates a row reference based on $path.

This reference will keep pointing to the node pointed to by $path, so long as it exists. If $path isn’t a valid path in $model, then undefined is returned. However, unlike references created with .new-treerowreference(), it does not listen to the model for changes. The creator of the row reference must do this explicitly using .inserted(), .deleted(), .reordered().

These functions must be called exactly once per proxy when the corresponding signal on the model is emitted. This single call updates all row references for that proxy. Since built-in GTK objects like Gnome::Gtk4::TreeView already use this mechanism internally, using them as the proxy object will produce unpredictable results. Further more, passing the same object as $model and $proxy doesn’t work for reasons of internal implementation.

This type of row reference is primarily meant by structures that need to carefully monitor exactly when a row reference updates itself, and is not generally needed by most applications.

method new-proxy ( N-Object() $proxy, N-Object() $model, N-Object $path --> Gnome::Gtk4::TreeRowReference \)
  • $proxy; a proxy Gnome::GObject::Object.

  • $model; a Gnome::Gtk4::R-TreeModel.

  • $path; a valid Gnome::Gtk4::N-TreePath to monitor

Methods

copy

Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10

Copies a Gnome::Gtk4::N-TreeRowReference.

method copy (--> N-Object )

Return value; a copy of $reference.

free

Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10

Free’s $reference. $reference may be undefined

method free ( )

get-model

Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10

Returns the model that the row reference is monitoring.

method get-model (--> N-Object )

Return value; the model.

get-path

Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10

Returns a path that the row reference currently points to, or undefined if the path pointed to is no longer valid.

method get-path (--> N-Object )

Return value; a current path.

valid

Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10

Returns True if the $reference is non-undefined and refers to a current valid path.

method valid (--> Bool )

Return value; True if $reference points to a valid path.

Functions

deleted

Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10

Lets a set of row reference created by .new-proxy() know that the model emitted the row-deleted signal.

method deleted ( N-Object() $proxy, N-Object $path )
  • $proxy; a Gnome::GObject::Object.

  • $path; the path position that was deleted

inserted

Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10

Lets a set of row reference created by .new-proxy() know that the model emitted the row-inserted signal.

method inserted ( N-Object() $proxy, N-Object $path )
  • $proxy; a Gnome::GObject::Object.

  • $path; the row position that was inserted

reordered

Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10

Lets a set of row reference created by .new-proxy() know that the model emitted the rows-reordered signal.

method reordered ( N-Object() $proxy, N-Object $path, N-Object $iter, Array[Int] $new-order )
  • $proxy; a Gnome::GObject::Object.

  • $path; the parent path of the reordered signal

  • $iter; the iter pointing to the parent of the reordered

  • $new-order; the new order of rows.