Sorts items by comparing strings.
To obtain the strings to compare, this sorter evaluates a [classGtk.Expression].
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.
Collation_Property : constant Gtk.String_Sorter.Property_Gtk_Collation;
Type: Gtk_Collation 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.
function Get_Collation
(Self : not null access Gtk_String_Sorter_Record) return Gtk_Collation
Gets which collation method the sorter uses. Since: gtk+ 4.10
The collation method
function Get_Expression
(Self : not null access Gtk_String_Sorter_Record)
return Gtk.Expression.Gtk_Expression
Gets the expression that is evaluated to obtain strings from items.
a GtkExpression. Has transfer-ownership='none'.
function Get_Ignore_Case
(Self : not null access Gtk_String_Sorter_Record) return Boolean
Gets whether the sorter ignores case differences.
True if Self is ignoring case differences
function Get_Type return Glib.GType
type Gtk_Collation is (
Collation_None,
Collation_Unicode,
Collation_Filename);
Describes how a [classGtk.StringSorter] turns strings into sort keys to compare them.
Note that the result of sorting will in general depend on the current locale unless the mode is Gtk_Collation_None.
package Gtk_Collation_Properties is
new Generic_Internal_Discrete_Property (Gtk_Collation);
procedure Gtk_New
(Self : out Gtk_String_Sorter;
Expression : Gtk.Expression.Gtk_Expression)
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. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
The expression to evaluate. Has transfer-ownership='full'.
type Gtk_String_Sorter is access all Gtk_String_Sorter_Record'Class;
function Gtk_String_Sorter_New
(Expression : Gtk.Expression.Gtk_Expression) return Gtk_String_Sorter
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.
The expression to evaluate. Has transfer-ownership='full'.
type Gtk_String_Sorter_Record is new Gtk_Sorter_Record with null record;
Ignore_Case_Property : constant Glib.Properties.Property_Boolean;
If sorting is case sensitive.
procedure Initialize
(Self : not null access Gtk_String_Sorter_Record'Class;
Expression : Gtk.Expression.Gtk_Expression)
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. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
The expression to evaluate. Has transfer-ownership='full'.
type Property_Gtk_Collation is new Gtk_Collation_Properties.Property;
procedure Set_Collation
(Self : not null access Gtk_String_Sorter_Record;
Collation : Gtk_Collation)
Sets the collation method to use for sorting. Since: gtk+ 4.10
the collation method
procedure Set_Expression
(Self : not null access Gtk_String_Sorter_Record;
Expression : Gtk.Expression.Gtk_Expression)
Sets the expression that is evaluated to obtain strings from items. The expression must have the type G_TYPE_STRING.
a GtkExpression
procedure Set_Ignore_Case
(Self : not null access Gtk_String_Sorter_Record;
Ignore_Case : Boolean)
Sets whether the sorter will ignore case differences.
True to ignore case differences