use [gtk.sort_list_model.SortListModel] to wrap your list model instead
gtk.tree_sortable_mixin
Module for [TreeSortable] interface mixin
Templates 2
The interface for sortable models used by GtkTreeView
[gtk.tree_sortable.TreeSortable] is an interface to be implemented by tree models which support sorting. The [gtk.tree_view.TreeView] uses the methods provided by this interface to sort the model.
Deprecated
Fills in sort_column_id and order with the current sort column and the order. It returns true unless the sort_column_id is [gtk.types.TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID] or [gtk.types.TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID].
Parameters
sortColumnId | The sort column id to be filled in |
order | The [gtk.types.SortType] to be filled in |
Returns
column ids.
Returns true if the model has a default sort function. This is used primarily by GtkTreeViewColumns in order to determine if a model can go back to the default state, or not.
Returns
Sets the default comparison function used when sorting to be sort_func. If the current sort column id of sortable is [gtk.types.TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID], then the model will sort using this function.
If sort_func is null, then there will be no default comparison function. This means that once the model has been sorted, it can’t go back to the default state. In this case, when the current sort column id of sortable is [gtk.types.TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID], the model will be unsorted.
Parameters
sortFunc | The comparison function |
Sets the current sort column to be sort_column_id. The sortable will resort itself to reflect this change, after emitting a GtkTreeSortable::sort-column-changed signal. sort_column_id may either be a regular column id, or one of the following special values:
- [gtk.types.TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID]: the default sort function
will be used, if it is set
- [gtk.types.TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID]: no sorting will occur
Parameters
sortColumnId | the sort column id to set |
order | The sort order of the column |
Sets the comparison function used when sorting to be sort_func. If the current sort column id of sortable is the same as sort_column_id, then the model will sort using this function.
Parameters
sortColumnId | the sort column id to set the function for |
sortFunc | The comparison function |
Emits a GtkTreeSortable::sort-column-changed signal on sortable.
Connect to SortColumnChanged signal.
The ::sort-column-changed signal is emitted when the sort column or sort order of sortable is changed. The signal is emitted before the contents of sortable are resorted.
Parameters
callback | signal callback delegate or function to connect void callback(gtk.tree_sortable.TreeSortable treeSortable) treeSortable the instance the signal is connected to (optional) |
after | Yes.After to execute callback after default handler, No.After to execute before (default) |