It derives from <GtkSorter>.
Sorts <GtkColumnView> columns.
The sorter returned by column-view: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 column-view-sorter:primary-sort-column and
column-view-sorter: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
column-view-sorter:get-nth-sort-column. To get
notified about changes, use 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);
}
The primary sort column.
The primary sort column is the one that displays the triangle in a column view header.
Its value is a <GtkColumnViewColumn>, or
#f.
It is read only.
The primary sort order.
The primary sort order determines whether the triangle displayed in the column view header of the primary sort column points upwards or downwards.
Its value is a <GtkSortType>.
It is read only.
Returns the number of columns by which the sorter sorts.
If the sorter of the primary sort column does not determine a total order, then the secondary sorters are consulted to break the ties.
Use the sorter:changed signal to get
notified when the number of sort columns changes.
Passed: a <GtkColumnViewSorter>.
a columnviewsorter
Returned: an unsigned 32-bit integer.
the number of sort columns
Gets the position’th sort column and its associated sort order.
Use the sorter:changed signal to get
notified when sort columns change.
Passed: a <GtkColumnViewSorter>.
a columnviewsorter
Passed: an unsigned 32-bit integer.
the position of the sort column to retrieve (0 for the primary sort column)
Returned: a <GtkColumnViewColumn>, or
#f.
the sort column at the position
Returned: a <GtkSortType>.
return location for the sort order
Returns the primary sort column.
The primary sort column is the one that displays the triangle in a column view header.
Passed: a <GtkColumnViewSorter>.
a columnviewsorter
Returned: a <GtkColumnViewColumn>, or
#f.
the primary sort column
Returns the primary sort order.
The primary sort order determines whether the triangle displayed in the column view header of the primary sort column points upwards or downwards.
If there is no primary sort column, then this function returns
ascending.
Passed: a <GtkColumnViewSorter>.
a columnviewsorter
Returned: a <GtkSortType>.
the primary sort order