Gtk.TreeSortable - Interfaces - Gtk 3.0 (original) (raw)
g GObject.GInterface GObject.GInterface Gtk.TreeSortable Gtk.TreeSortable GObject.GInterface->Gtk.TreeSortable
Implementations:
Gtk.ListStore, Gtk.TreeModelSort, Gtk.TreeStore
Methods¶
get_sort_column_id () |
---|
has_default_sort_func () |
set_default_sort_func (sort_func, *user_data) |
set_sort_column_id (sort_column_id, order) |
set_sort_func (sort_column_id, sort_func, *user_data) |
sort_column_changed () |
Virtual Methods¶
do_get_sort_column_id () |
---|
do_has_default_sort_func () |
do_set_default_sort_func (sort_func, *user_data) |
do_set_sort_column_id (sort_column_id, order) |
do_set_sort_func (sort_column_id, sort_func, *user_data) |
do_sort_column_changed () |
Properties¶
None
Signals¶
Name | Short Description |
---|---|
sort-column-changed | The ::sort-column-changed signal is emitted when the sort column or sort order of sortable is changed. |
Fields¶
None
Class Details¶
class Gtk.TreeSortable¶
Bases:
Structure:
Gtk.TreeSortable is an interface to be implemented by tree models which support sorting. The Gtk.TreeView uses the methods provided by this interface to sort the model.
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_ID orGtk.TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID.
has_default_sort_func()[source]¶
Returns:
True, if the model has a default sort function
Return type:
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.
set_default_sort_func(sort_func, *user_data)[source]¶
Parameters:
- sort_func (Gtk.TreeIterCompareFunc) – The comparison function
- user_data (object or None) – User data to pass to sort_func, or None
Sets the default comparison function used when sorting to be sort_func. If the current sort column id of self isGtk.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 selfis Gtk.TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, the model will be unsorted.
set_sort_column_id(sort_column_id, order)[source]¶
Parameters:
- sort_column_id (int) – the sort column id to set
- order (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 aGtk.TreeSortable ::sort-column-changed signal. 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 set
- Gtk.TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID: no sorting will occur
set_sort_func(sort_column_id, sort_func, *user_data)[source]¶
Parameters:
- sort_column_id (int) – the sort column id to set the function for
- sort_func (Gtk.TreeIterCompareFunc) – The comparison function
- user_data (object or None) – User data to pass to sort_func, or None
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.
sort_column_changed()[source]¶
Emits a Gtk.TreeSortable ::sort-column-changed signal on self.
do_get_sort_column_id() virtual¶
Returns:
True if 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 Gtk.SortType to 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 True unless the sort_column_id isGtk.TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID orGtk.TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID.
do_has_default_sort_func() virtual¶
Returns:
True, if the model has a default sort function
Return type:
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.
do_set_default_sort_func(sort_func, *user_data) virtual¶
Parameters:
- sort_func (Gtk.TreeIterCompareFunc) – The comparison function
- user_data (object or None) – User data to pass to sort_func, or None
Sets the default comparison function used when sorting to be sort_func. If the current sort column id of sortable isGtk.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 sortableis Gtk.TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, the model will be unsorted.
do_set_sort_column_id(sort_column_id, order) virtual¶
Parameters:
- sort_column_id (int) – the sort column id to set
- order (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 aGtk.TreeSortable ::sort-column-changed signal. 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 set
- Gtk.TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID: no sorting will occur
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 for
- sort_func (Gtk.TreeIterCompareFunc) – The comparison function
- user_data (object or None) – User data to pass to sort_func, or None
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.
do_sort_column_changed() virtual¶
Emits a Gtk.TreeSortable ::sort-column-changed signal on sortable.
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-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.