About my projects, examples and tutorials
Gnome::Gtk4::NumericSorter

Gnome::Gtk4::NumericSorter

Description§

Gnome::Gtk4::NumericSorter is a Gnome::Gtk4::Sorter that compares numbers.

To obtain the numbers to compare, this sorter evaluates a Gnome::Gtk4::Expression.

Uml Diagram§

UNKNOWN image§

=for image :class<inline> :src<asset_files/images/plantuml/NumericSorter.png> :width<70\%>

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! )
Code

new-numericsorter§

Creates a new numeric sorter using the given $expression.

Smaller numbers will be sorted first. You can call .set-sort-order() to change this.

method new-numericsorter ( N-Object() $expression --> Gnome::Gtk4::NumericSorter )
Code
  • $expression; (transfer ownership: full) The expression to evaluate.

Methods§

get-expression§

Gets the expression that is evaluated to obtain numbers from items.

method get-expression (--> N-Object )
Code

Return value; a Gnome::Gtk4::Expression.

get-sort-order§

Gets whether this sorter will sort smaller numbers first.

method get-sort-order (--> GtkSortType )
Code

Return value; the order of the numbers.

set-expression§

Sets the expression that is evaluated to obtain numbers from items.

Unless an expression is set on $self, the sorter will always compare items as invalid.

The expression must have a return type that can be compared numerically, such as G_TYPE_INT or G_TYPE_DOUBLE.

method set-expression ( N-Object() $expression )
Code

set-sort-order§

Sets whether to sort smaller numbers before larger ones.

method set-sort-order ( GtkSortType $sort-order )
Code
  • $sort-order; whether to sort smaller numbers first.