Gtk.StringSorter¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
|||
r/w/en |
|||
r/w/en |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Gtk.StringSorter(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
GtkStringSorter
is aGtkSorter
that compares strings.It does the comparison in a linguistically correct way using the current locale by normalizing Unicode strings and possibly case-folding them before performing the comparison.
To obtain the strings 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
GtkStringSorter
- Return type:
Creates a new string sorter that compares items using the given expression.
Unless an expression is set on it, this sorter will always compare items as invalid.
- get_collation()[source]¶
- Returns:
The collation method
- Return type:
Gets which collation method the sorter uses.
New in version 4.10.
- get_expression()[source]¶
- Returns:
a
GtkExpression
- Return type:
Gets the expression that is evaluated to obtain strings from items.
- set_collation(collation)[source]¶
- Parameters:
collation (
Gtk.Collation
) – the collation method
Sets the collation method to use for sorting.
New in version 4.10.
- set_expression(expression)[source]¶
- Parameters:
expression (
Gtk.Expression
orNone
) – aGtkExpression
Sets the expression that is evaluated to obtain strings from items.
The expression must have the type
GObject.TYPE_STRING
.
Property Details¶
- Gtk.StringSorter.props.collation¶
- Name:
collation
- Type:
- Default Value:
- Flags:
The collation method to use for sorting.
The
GTK_COLLATION_NONE
value is useful when the expression already returns collation keys, or strings that need to be compared byte-by-byte.The default value,
GTK_COLLATION_UNICODE
, compares strings according to the Unicode collation algorithm.New in version 4.10.
- Gtk.StringSorter.props.expression¶
- Name:
expression
- Type:
- Default Value:
- Flags:
The expression to evaluate on item to get a string to compare with.