1.35 <GtkColumnViewSorter>

Class: <GtkColumnViewSorter>

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);
  }

Properties

Property: column-view-sorter:primary-sort-column self

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.

Property: column-view-sorter:primary-sort-order self

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.

Procedures

Method: column-view-sorter:get-n-sort-columns self ⇒ %return
Method: get-n-sort-columns self ⇒ %return

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.

self

Passed: a <GtkColumnViewSorter>.

a columnviewsorter

%return

Returned: an unsigned 32-bit integer.

the number of sort columns

Method: column-view-sorter:get-nth-sort-column self position ⇒ %return sort-order
Method: get-nth-sort-column self position ⇒ %return sort-order

Gets the position’th sort column and its associated sort order.

Use the sorter:changed signal to get notified when sort columns change.

self

Passed: a <GtkColumnViewSorter>.

a columnviewsorter

position

Passed: an unsigned 32-bit integer.

the position of the sort column to retrieve (0 for the primary sort column)

%return

Returned: a <GtkColumnViewColumn>, or #f.

the sort column at the position

sort-order

Returned: a <GtkSortType>.

return location for the sort order

Method: column-view-sorter:get-primary-sort-column self ⇒ %return
Method: get-primary-sort-column self ⇒ %return

Returns the primary sort column.

The primary sort column is the one that displays the triangle in a column view header.

self

Passed: a <GtkColumnViewSorter>.

a columnviewsorter

%return

Returned: a <GtkColumnViewColumn>, or #f.

the primary sort column

Method: column-view-sorter:get-primary-sort-order self ⇒ %return
Method: get-primary-sort-order self ⇒ %return

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.

self

Passed: a <GtkColumnViewSorter>.

a columnviewsorter

%return

Returned: a <GtkSortType>.

the primary sort order