Package: gtk

Class gtk:column-view-sorter

Superclasses

gtk:sorter, gobject:object, common-lisp:standard-object, common-lisp:t

Documented Subclasses

None

Direct Slots

primary-sort-column
The primary-sort-column property of type gtk:column-view-column (Read)
The primary sort column is the one that displays the triangle in a column view header.
Default value: 0
primary-sort-order
The primary-sort-order property of type gtk:sort-type (Read)
The primary sort order determines whether the triangle displayed in the column view header of the primary sort column points upwards or downwards.
Default value: :ascending

Details

The gtk:column-view-sorter class is a sorter implementation that is geared towards the needs of the gtk:column-view widget. The sorter returned by the gtk:column-view-sorter function is a gtk:column-view-sorter object.

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

If you are only interested in the primary sort column, that is, the column where a sort indicator is shown in the header, then you can just look at the primary-sort-column and primary-sort-order properties.

If you want to store the full sort configuration, including secondary sort columns that are used for tie breaking, then you can use the gtk:column-view-sorter-nth-sort-column function. To get notified about changes, use the "changed" signal.

Since 4.10

Examples

To restore a saved sort configuration on a gtk:column-view widget, 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);
  }    
 

Slot Access Functions

Inherited Slot Access Functions

See also

2024-10-24