1.194 <GtkStringSorter>

Class: <GtkStringSorter>

It derives from <GtkSorter>.

Sorts items by comparing strings.

To obtain the strings to compare, this sorter evaluates a <GtkExpression>.

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.

Properties

Property: string-sorter:collation self

The collation method to use for sorting.

The none value is useful when the expression already returns collation keys, or strings that need to be compared byte-by-byte.

The default value, unicode, compares strings according to the Unicode collation algorithm.

Its value is a <GtkCollation> (or, to set it, one of its symbols).

Set it with (set! (string-sorter:collation self) value).

Property: string-sorter:expression self

The expression to evaluate on item to get a string to compare with.

Its value is a <GtkExpression>, or #f.

Set it with (set! (string-sorter:expression self) value).

Property: string-sorter:ignore-case self

If sorting is case sensitive.

Its value is a boolean.

Set it with (set! (string-sorter:ignore-case self) value).

Procedures

Method: string-sorter:get-collation self ⇒ %return
Method: get-collation self ⇒ %return

Gets which collation method the sorter uses.

self

Passed: a <GtkStringSorter>.

a <GtkStringSorter>

%return

Returned: a <GtkCollation>.

The collation method

Method: string-sorter:get-expression self ⇒ %return
Method: get-expression self ⇒ %return

Gets the expression that is evaluated to obtain strings from items.

self

Passed: a <GtkStringSorter>.

a <GtkStringSorter>

%return

Returned: a <GtkExpression>, or #f.

a <GtkExpression>

Method: string-sorter:get-ignore-case? self ⇒ %return
Method: get-ignore-case? self ⇒ %return

Gets whether the sorter ignores case differences.

self

Passed: a <GtkStringSorter>.

a <GtkStringSorter>

%return

Returned: a boolean.

#t if self is ignoring case differences

Procedure: string-sorter:new [expression] ⇒ %return

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.

expression

Passed, or left out: a <GtkExpression>, or #f.

The expression to evaluate

%return

Returned: a <GtkStringSorter>.

a new <GtkStringSorter>

Method: string-sorter:set-collation self collation
Method: set-collation self collation

Sets the collation method to use for sorting.

self

Passed: a <GtkStringSorter>.

a <GtkStringSorter>

collation

Passed: a <GtkCollation>, or one of its symbols.

the collation method

Method: string-sorter:set-expression self [expression]
Method: set-expression self [expression]

Sets the expression that is evaluated to obtain strings from items.

The expression must have the type G_TYPE_STRING.

self

Passed: a <GtkStringSorter>.

a <GtkStringSorter>

expression

Passed, or left out: a <GtkExpression>, or #f.

a <GtkExpression>

Method: string-sorter:set-ignore-case self ignore-case
Method: set-ignore-case self ignore-case

Sets whether the sorter will ignore case differences.

self

Passed: a <GtkStringSorter>.

a <GtkStringSorter>

ignore-case

Passed: a boolean.

#t to ignore case differences