It derives from <GObject>.
Describes sorting criteria for a
<GtkSortListModel>.
Its primary user is <GtkSortListModel>
The model will use a sorter to determine the order in which its items
should appear by calling sorter:compare for
pairs of items.
Sorters may change their sorting behavior through their lifetime. In
that case, they will emit the sorter:changed signal to notify that the sort order is no
longer valid and should be updated by calling sorter:compare again.
GTK provides various pre-made sorter implementations for common sorting
operations. <GtkColumnView> has built-in
support for sorting lists via the column-view-column:sorter property, where the user can change
the sorting by clicking on list headers.
Of course, in particular for large lists, it is also possible to
subclass <GtkSorter> and provide one’s own sorter.
parent-instanceNotifies all users of the sorter that it has changed.
This emits the sorter:changed
signal. Users of the sorter should then update the sort order via
sorter:compare.
Depending on the change parameter, it may be possible to update
the sort order without a full resorting. Refer to the
<GtkSorterChange> documentation for details.
This function is intended for implementers of
<GtkSorter> subclasses and should not be called
from other functions.
Passed: a <GtkSorter>.
Passed: a <GtkSorterChange>, or one of its
symbols.
How the sorter changed
Compares two given items according to the sort order implemented by the sorter.
Sorters implement a partial order:
The sorter may signal it conforms to additional constraints via the
return value of sorter:get-order.
Passed: a <GtkSorter>.
Passed: a <GObject>.
first item to compare
Passed: a <GObject>.
second item to compare
Returned: a <GtkOrdering>.
equal if item1 == item2,
smaller if item1 < item2,
larger if item1 > item2
Gets the order that self conforms to.
See <GtkSorterOrder> for details of the
possible return values.
This function is intended to allow optimizations.
Passed: a <GtkSorter>.
Returned: a <GtkSorterOrder>.
The order
Connect a handler with (connect object sorter:changed handler).
It is called as (handler self change).
Emitted whenever the sorter changed.
Users of the sorter should then update the sort order again via
sorter:compare.
<GtkSortListModel> handles this signal
automatically.
Depending on the change parameter, it may be possible to update
the sort order without a full resorting. Refer to the
<GtkSorterChange> documentation for details.
Passed: a <GtkSorter>.
Passed: a <GtkSorterChange>.
how the sorter changed
Compares two given items according to the sort order implemented by the sorter.
Sorters implement a partial order:
The sorter may signal it conforms to additional constraints via the
return value of sorter:get-order.
To override it in a new class, give register-type #:vfuncs
`((compare . ,procedure)). The procedure is called as
(procedure self item1 item2) ⇒ %return.
Passed: the class whose implementation to call:
<GtkSorter>, or a class that derives from it, or
its GType number.
Passed: a <GtkSorter>.
Passed, or left out: a <GObject>, or
#f.
first item to compare
Passed, or left out: a <GObject>, or
#f.
second item to compare
Returned: a <GtkOrdering>.
equal if item1 == item2,
smaller if item1 < item2,
larger if item1 > item2
Gets the order that self conforms to.
See <GtkSorterOrder> for details of the
possible return values.
This function is intended to allow optimizations.
To override it in a new class, give register-type #:vfuncs
`((get-order . ,procedure)). The procedure is called as
(procedure self) ⇒ %return.
Passed: the class whose implementation to call:
<GtkSorter>, or a class that derives from it, or
its GType number.
Passed: a <GtkSorter>.
Returned: a <GtkSorterOrder>.
The order