Class: Gtk::Sorter
- Inherits:
-
Object
- Object
- Gtk::Sorter
- Defined in:
- (unknown)
Overview
The virtual table for GtkSorter.
Direct Known Subclasses
ColumnViewSorter, CustomSorter, MultiSorter, NumericSorter, StringSorter, TreeListRowSorter
Instance Method Summary collapse
-
#changed(change) ⇒ nil
Notifies all users of the sorter that it has changed.
-
#compare(item1, item2) ⇒ Gtk::Ordering
Compares two given items according to the sort order implemented by the sorter.
-
#order ⇒ Gtk::SorterOrder
Gets the order that self conforms to.
Instance Method Details
#changed(change) ⇒ nil
Notifies all users of the sorter that it has changed.
This emits the [signalGtk.Sorter::changed] signal. Users of the sorter should then update the sort order via [methodGtk.Sorter.compare].
Depending on the change parameter, it may be possible to update the sort order without a full resorting. Refer to the [enumGtk.SorterChange] documentation for details.
This function is intended for implementers of GtkSorter
subclasses and should not be called from other functions.
#compare(item1, item2) ⇒ Gtk::Ordering
Compares two given items according to the sort order implemented by the sorter.
Sorters implement a partial order:
- It is reflexive, ie a = a
- It is antisymmetric, ie if a < b and b < a, then a = b
- It is transitive, ie given any 3 items with a ≤ b and b ≤ c, then a ≤ c
The sorter may signal it conforms to additional constraints via the return value of [methodGtk.Sorter.get_order].
#order ⇒ Gtk::SorterOrder
Gets the order that self conforms to.
See [enumGtk.SorterOrder] for details of the possible return values.
This function is intended to allow optimizations.