Class

GtkSorter

[]

Description [src]

class Gtk.Sorter : GObject.Object
{
  /* No available fields */
}

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 gtk_sorter_compare() for pairs of items.

Sorters may change their sorting behavior through their lifetime. In that case, they will emit the GtkSorter::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. GtkColumnView has built-in support for sorting lists via the GtkColumnViewColumn: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.

[]

Hierarchy

hierarchy this GtkSorter ancestor_0 GObject ancestor_0--this
[]

Ancestors

[]

Instance methods

gtk_sorter_changed

Notifies all users of the sorter that it has changed.

gtk_sorter_compare

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

gtk_sorter_get_order

Gets the order that self conforms to.

Methods inherited from GObject (43)
[]

Signals

Gtk.Sorter::changed

Emitted whenever the sorter changed.

Signals inherited from GObject (1)

Class structure

[]

Virtual methods

Gtk.SorterClass.compare

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

Gtk.SorterClass.get_order

Gets the order that self conforms to.