Gtk.TreeSortable¶
- Implementations:
Methods¶
|
|
|
|
|
|
Virtual Methods¶
|
|
|
|
|
|
Properties¶
None
Signals¶
Name |
Short Description |
|---|---|
The |
Fields¶
None
Class Details¶
- class Gtk.TreeSortable¶
- Bases:
- Structure:
The interface for sortable models used by
Gtk.TreeViewGtkTreeSortableis an interface to be implemented by tree models which support sorting. TheGtkTreeViewuses the methods provided by this interface to sort the model.Deprecated since version 4.10: There is no replacement for this interface. You should use [class`Gtk`.SortListModel] to wrap your list model instead
- get_sort_column_id()[source]¶
- Returns:
(None, None) if the sort column is one of the special sort column ids. Otherwise a tuple containing:
- sort_column_id:
The sort column id
- order:
The
Gtk.SortType
- Return type:
(sort_column_id:
int, order:Gtk.SortType) or (None,None)
Returns sort_column_id and order with the current sort column and the order. It returns (
None,None) if the sort_column_id isGtk.TREE_SORTABLE_DEFAULT_SORT_COLUMN_IDorGtk.TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID.Deprecated since version 4.10.
- has_default_sort_func()[source]¶
-
Returns
Trueif 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.Deprecated since version 4.10.
- set_default_sort_func(sort_func, *user_data)[source]¶
- Parameters:
sort_func (
Gtk.TreeIterCompareFunc) – The comparison function
Sets the default comparison function used when sorting to be sort_func. If the current sort column id of self is
Gtk.TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, then the model will sort using this function.If sort_func is
None, 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 self isGtk.TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, the model will be unsorted.Deprecated since version 4.10.
- set_sort_column_id(sort_column_id, order)[source]¶
- Parameters:
sort_column_id (
int) – the sort column id to setorder (
Gtk.SortType) – The sort order of the column
Sets the current sort column to be sort_column_id. The self will resort itself to reflect this change, after emitting a
GtkTreeSortable::sort-column-changedsignal. sort_column_id may either be a regular column id, or one of the following special values:Gtk.TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID: the default sort function will be used, if it is setGtk.TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID: no sorting will occur
Deprecated since version 4.10.
- set_sort_func(sort_column_id, sort_func, *user_data)[source]¶
- Parameters:
sort_column_id (
int) – the sort column id to set the function forsort_func (
Gtk.TreeIterCompareFunc) – The comparison function
Sets the comparison function used when sorting to be sort_func. If the current sort column id of self is the same as sort_column_id, then the model will sort using this function.
Deprecated since version 4.10.
- sort_column_changed()[source]¶
Emits a
GtkTreeSortable::sort-column-changedsignal on self.Deprecated since version 4.10.
- do_get_sort_column_id() virtual¶
- Returns:
Trueif the sort column is not one of the special sort column ids.- sort_column_id:
The sort column id to be filled in
- order:
The
GtkSortTypeto be filled in
- Return type:
(
bool, sort_column_id:int, order:Gtk.SortType)
Fills in sort_column_id and order with the current sort column and the order. It returns
Trueunless the sort_column_id isGtk.TREE_SORTABLE_DEFAULT_SORT_COLUMN_IDorGtk.TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID.Deprecated since version 4.10.
- do_has_default_sort_func() virtual¶
-
Returns
Trueif 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.Deprecated since version 4.10.
- do_set_default_sort_func(sort_func, *user_data) virtual¶
- Parameters:
sort_func (
Gtk.TreeIterCompareFunc) – The comparison function
Sets the default comparison function used when sorting to be sort_func. If the current sort column id of sortable is
Gtk.TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, then the model will sort using this function.If sort_func is
None, 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 isGtk.TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, the model will be unsorted.Deprecated since version 4.10.
- do_set_sort_column_id(sort_column_id, order) virtual¶
- Parameters:
sort_column_id (
int) – the sort column id to setorder (
Gtk.SortType) – The sort order of the column
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-changedsignal. sort_column_id may either be a regular column id, or one of the following special values:Gtk.TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID: the default sort function will be used, if it is setGtk.TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID: no sorting will occur
Deprecated since version 4.10.
- do_set_sort_func(sort_column_id, sort_func, *user_data) virtual¶
- Parameters:
sort_column_id (
int) – the sort column id to set the function forsort_func (
Gtk.TreeIterCompareFunc) – The comparison function
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.
Deprecated since version 4.10.
- do_sort_column_changed() virtual¶
Emits a
GtkTreeSortable::sort-column-changedsignal on sortable.Deprecated since version 4.10.
Signal Details¶
- Gtk.TreeSortable.signals.sort_column_changed(tree_sortable)¶
- Signal Name:
sort-column-changed- Flags:
- Parameters:
tree_sortable (
Gtk.TreeSortable) – The object which received the signal
The
::sort-column-changedsignal is emitted when the sort column or sort order of sortable is changed. The signal is emitted before the contents of sortable are resorted.