Gtk.NumericSorter¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
|||
r/w/en |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Gtk.NumericSorter(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
GtkNumericSorter
is aGtkSorter
that compares numbers.To obtain the numbers to compare, this sorter evaluates a [class`Gtk`.Expression].
- classmethod new(expression)[source]¶
- Parameters:
expression (
Gtk.Expression
orNone
) – The expression to evaluate- Returns:
a new
GtkNumericSorter
- Return type:
Creates a new numeric sorter using the given expression.
Smaller numbers will be sorted first. You can call [method`Gtk`.NumericSorter.set_sort_order] to change this.
- get_expression()[source]¶
- Returns:
a
GtkExpression
- Return type:
Gets the expression that is evaluated to obtain numbers from items.
- get_sort_order()[source]¶
- Returns:
the order of the numbers
- Return type:
Gets whether this sorter will sort smaller numbers first.
- set_expression(expression)[source]¶
- Parameters:
expression (
Gtk.Expression
orNone
) – aGtkExpression
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
GObject.TYPE_INT
orGObject.TYPE_DOUBLE
.
- set_sort_order(sort_order)[source]¶
- Parameters:
sort_order (
Gtk.SortType
) – whether to sort smaller numbers first
Sets whether to sort smaller numbers before larger ones.
Property Details¶
- Gtk.NumericSorter.props.expression¶
- Name:
expression
- Type:
- Default Value:
- Flags:
The expression to evaluate on items to get a number to compare with.
- Gtk.NumericSorter.props.sort_order¶
- Name:
sort-order
- Type:
- Default Value:
- Flags:
Whether the sorter will sort smaller numbers first.