Sorter

open class Sorter(pointer: <Error class: unknown class><<Error class: unknown class>>)

GtkSorter is an object to describe sorting criteria.

Its primary user is class@Gtk.SortListModel

The model will use a sorter to determine the order in which its items should appear by calling method@Gtk.Sorter.compare for pairs of items.

Sorters may change their sorting behavior through their lifetime. In that case, they will emit the signal@Gtk.Sorter::changed signal to notify that the sort order is no longer valid and should be updated by calling gtk_sorter_compare() again.

GTK provides various pre-made sorter implementations for common sorting operations. class@Gtk.ColumnView has built-in support for sorting lists via the property@Gtk.ColumnViewColumn: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.

Inheritors

Constructors

Link copied to clipboard
constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val gtkSorterPointer: <Error class: unknown class><<Error class: unknown class>>

Functions

Link copied to clipboard
open fun changed(change: SorterChange)

Notifies all users of the sorter that it has changed.

Link copied to clipboard
open fun compare(item1: <Error class: unknown class>, item2: <Error class: unknown class>): Ordering

Compares two given items according to the sort order implemented by the sorter.

Link copied to clipboard
fun connectChanged(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (change: SorterChange) -> Unit): <Error class: unknown class>

Emitted whenever the sorter changed.

Link copied to clipboard
open fun getOrder(): SorterOrder

Gets the order that @self conforms to.