Gnome::Gtk4::R-TreeSortable
Description
The interface for sortable models used by GtkTreeView
Gnome::Gtk4::R-TreeSortable is an interface to be implemented by tree models which support sorting. The Gnome::Gtk4::TreeView uses the methods provided by this interface to sort the model.
Methods
get-sort-column-id
Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10
Fills in $sort-column-id
and $order
with the current sort column and the order. It returns True
unless the $sort-column-id
is GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID
or GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID
.
method get-sort-column-id ( Array[Int] $sort-column-id, GtkSortType $order --> Bool )
$sort-column-id; (transfer ownership: full) The sort column id to be filled in.
$order; (transfer ownership: full) The
enumeration GtkSortType defined in Gnome::Gtk4::T-enums
to be filled in.
Return value; True
if the sort column is not one of the special sort column ids..
has-default-sort-func
Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10
Returns True
if the model has a default sort function. This is used primarily by GtkTreeViewColumns in order to determine if a model can go back to the default state, or not.
method has-default-sort-func (--> Bool )
Return value; True
, if the model has a default sort function.
set-default-sort-func This function is not yet available
Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10
Sets the default comparison function used when sorting to be $sort-func
. If the current sort column id of $sortable
is GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID
, then the model will sort using this function.
If $sort-func
is undefined, then there will be no default comparison function. This means that once the model has been sorted, it can’t go back to the default state. In this case, when the current sort column id of $sortable
is GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID
, the model will be unsorted.
method set-default-sort-func ( &sort-func, gpointer $user-data, … )
&sort-func; The comparison function. Tthe function must be specified with following signature;
:( N-Object $model, N-Object $a, N-Object $b, gpointer $user-data --
gint )>.$user-data; User data to pass to
$sort-func
.destroy; Destroy notifier of
$user-data
. Note that each argument must be specified as a type followed by its value!
set-sort-column-id
Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10
Sets the current sort column to be $sort-column-id
. The $sortable
will resort itself to reflect this change, after emitting a Gnome::Gtk4::R-TreeSortable::sort-column-changed` signal. $sort-column-id
may either be a regular column id, or one of the following special values:
GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID
: the default sort function will be used, if it is setGTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID
: no sorting will occur
method set-sort-column-id ( Int() $sort-column-id, GtkSortType $order )
$sort-column-id; the sort column id to set.
$order; The sort order of the column.
set-sort-func This function is not yet available
Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10
Sets the comparison function used when sorting to be $sort-func
. If the current sort column id of $sortable
is the same as $sort-column-id
, then the model will sort using this function.
method set-sort-func ( Int() $sort-column-id, &sort-func, gpointer $user-data, … )
$sort-column-id; the sort column id to set the function for.
&sort-func; The comparison function. Tthe function must be specified with following signature;
:( N-Object $model, N-Object $a, N-Object $b, gpointer $user-data --
gint )>.$user-data; User data to pass to
$sort-func
.destroy; Destroy notifier of
$user-data
. Note that each argument must be specified as a type followed by its value!
sort-column-changed
Note: The native version of this routine is deprecated in gtk4-lib() since version 4.10
Emits a Gnome::Gtk4::R-TreeSortable::sort-column-changed` signal on $sortable
.
method sort-column-changed ( )
Signals
sort-column-changed
The sort-column-changed signal is emitted when the sort column or sort order of $sortable
is changed. The signal is emitted before the contents of $sortable
are resorted.
method handler ( Int :$_handle_id, N-GObject :$_native-object, Gnome::Gtk4::TreeSortable :$_widget, *C<user>-options )
$_handle_id; The registered event handler id.
$_native-object; The native object provided by the Raku object which registered this event. This a native Gnome::Gtk4::TreeSortable object.
$_widget; The object which registered the signal. User code may have left the object going out of scope.
user
-options; A list of named arguments provided at the.register-signal()
method from Gnome::GObject::Object.