Package: gtk

Class gtk:sorter

Superclasses

gobject:object, common-lisp:standard-object, common-lisp:t

Documented Subclasses

Direct Slots

None

Details

The gtk:sorter object is the way to describe sorting criteria. Its primary user is the gtk:sort-list-model object. The model will use a sorter to determine the order in which its items should appear by calling the gtk:sorter-compare function for pairs of items.

Sorters may change their sorting behavior through their lifetime. In that case, they will emit the "changed" signal to notify that the sort order is no longer valid and should be updated by calling the gtk:sorter-compare function again.

GTK provides various pre-made sorter implementations for common sorting operations. The gtk:column-view widget has built-in support for sorting lists via the 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 the gtk:sorter object and provide one's own sorter.

Signal Details

The "changed" signal
lambda (sorter change)    :run-last      
sorter
The gtk:sorter object.
change
How the sorter changed as a gtk:sorter-change value.
This signal is emitted whenever the sorter changed. Users of the sorter should then update the sort order again via the gtk:sorter-compare function. The gtk:sort-list-model object 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 gtk:sorter-change documentation for details.
 

Inherited Slot Access Functions

See also

2024-10-18