
Gnome::Gtk4::CustomSorter
Description
Gnome::Gtk4::CustomSorter is a Gnome::Gtk4::Sorter implementation that sorts via a callback function.
Uml Diagram

Class initialization
new
:native-object
Create an object using a native object from an object of the same type found elsewhere. See also Gnome::N::TopLevelSupportClass.
multi method new ( N-Object() :$native-object! )
new-customsorter
Creates a new Gnome::Gtk4::Sorter that works by calling $sort-func
to compare items.
If $sort-func
is undefined, all items are considered equal.
method new-customsorter ( GCompareDataFunc &sort-func, gpointer $user-data, GDestroyNotify &user-destroy --> Gnome::Gtk4::CustomSorter )
GCompareDataFunc &sort-func; the Gnome::Glib::T-types to use for sorting. The function must be specified with the following signature;
:( gpointer $a, gpointer $b, gpointer $user-data )
.$user-data; user data to pass to
$sort-func
.GDestroyNotify &user-destroy; destroy notify for
$user-data
. The function must be specified with the following signature;:( gpointer $data )
.
Methods
set-sort-func
Sets (or unsets) the function used for sorting items.
If $sort-func
is undefined, all items are considered equal.
If the sort func changes its sorting behavior, gtk_sorter_changed() needs to be called.
If a previous function was set, its $user-destroy
will be called now.
method set-sort-func ( GCompareDataFunc &sort-func, gpointer $user-data, GDestroyNotify &user-destroy )
GCompareDataFunc &sort-func; function to sort items. The function must be specified with the following signature;
:( gpointer $a, gpointer $b, gpointer $user-data )
.$user-data; user data to pass to
$match-func
.GDestroyNotify &user-destroy; destroy notify for
$user-data
. The function must be specified with the following signature;:( gpointer $data )
.