Gtk.TreeSortable¶
- Implementations:
Methods¶
|
|
|
|
|
|
Virtual Methods¶
|
|
|
|
|
|
Properties¶
None
Signals¶
Name |
Short Description |
---|---|
The |
Fields¶
None
Class Details¶
- class Gtk.TreeSortable¶
- Bases:
- Structure:
Gtk.TreeSortable
is an interface to be implemented by tree models which support sorting. TheGtk.TreeView
uses the methods provided by this interface to sort the model.- 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_ID
orGtk.TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID
.
- has_default_sort_func()[source]¶
-
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 functionuser_data (
object
orNone
) – User data to pass to sort_func, orNone
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.
- 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
Gtk.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 setGtk.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 forsort_func (
Gtk.TreeIterCompareFunc
) – The comparison functionuser_data (
object
orNone
) – User data to pass to sort_func, orNone
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. 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 functionuser_data (
object
orNone
) – User data to pass to sort_func, orNone
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.
- 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
Gtk.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 setGtk.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 forsort_func (
Gtk.TreeIterCompareFunc
) – The comparison functionuser_data (
object
orNone
) – User data to pass to sort_func, orNone
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.