Gtk.NumericSorter¶
class — extends Sorter
Sorts items numerically.
To obtain the numbers to compare, this sorter evaluates a
Expression.
Constructors¶
new¶
Creates a new numeric sorter using the given expression.
Smaller numbers will be sorted first. You can call
NumericSorter.set_sort_order to change this.
Parameters:
expression— The expression to evaluate
Methods¶
get_expression¶
Gets the expression that is evaluated to obtain numbers from items.
get_sort_order¶
Gets whether this sorter will sort smaller numbers first.
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.
Parameters:
expression— aGtkExpression
set_sort_order¶
Sets whether to sort smaller numbers before larger ones.
Parameters:
sort_order— whether to sort smaller numbers first
Properties¶
expression¶
The expression to evaluate on items to get a number to compare with.
sort_order¶
Whether the sorter will sort smaller numbers first.