NumericSorter#
GtkNumericSorter is a GtkSorter that compares numbers.
To obtain the numbers to compare, this sorter evaluates a
Expression.
Constructors#
- class NumericSorter
- classmethod new(expression: Expression | None = None) NumericSorter#
Creates a new numeric sorter using the given
expression.Smaller numbers will be sorted first. You can call
set_sort_orderto change this.- Parameters:
expression – The expression to evaluate
Methods#
- class NumericSorter
- get_expression() Expression | None#
Gets the expression that is evaluated to obtain numbers from items.
- set_expression(expression: Expression | None = None) None#
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
intorfloat.- Parameters:
expression – a
GtkExpression
Properties#
- class NumericSorter
- props.expression: Expression#
The type of the None singleton.