ColumnViewSorter

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

GtkColumnViewSorter is a sorter implementation that is geared towards the needs of GtkColumnView.

The sorter returned by method@Gtk.ColumnView.get_sorter is a GtkColumnViewSorter.

In column views, sorting can be configured by associating sorters with columns, and users can invert sort order by clicking on column headers. The API of GtkColumnViewSorter is designed to allow saving and restoring this configuration.

If you are only interested in the primary sort column (i.e. the column where a sort indicator is shown in the header), then you can just look at property@Gtk.ColumnViewSorter:primary-sort-column and property@Gtk.ColumnViewSorter:primary-sort-order.

If you want to store the full sort configuration, including secondary sort columns that are used for tie breaking, then you can use method@Gtk.ColumnViewSorter.get_nth_sort_column. To get notified about changes, use signal@Gtk.Sorter::changed.

To restore a saved sort configuration on a GtkColumnView, use code like:

sorter = gtk_column_view_get_sorter (view);
for (i = gtk_column_view_sorter_get_n_sort_columns (sorter) - 1; i >= 0; i--)
{
column = gtk_column_view_sorter_get_nth_sort_column (sorter, i, &order);
gtk_column_view_sort_by_column (view, column, order);
}

Skipped during bindings generation

  • parameter sort_order: sort_order: Out parameter is not supported

Since

4.10

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 gtkColumnViewSorterPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
val gtkSorterPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard

The primary sort column.

Link copied to clipboard

The primary sort order.

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 getNSortColumns(): <Error class: unknown class>

Returns the number of columns by which the sorter sorts.

Link copied to clipboard
open fun getOrder(): SorterOrder

Gets the order that @self conforms to.

Link copied to clipboard

Returns the primary sort column.

Link copied to clipboard

Returns the primary sort order.