#include <treesortable.h>
Definition at line 71 of file treesortable.h.
◆ SlotCompare
This callback should return -1 if a compares before b, 0 if they compare equal, 1 if a compares after b. For instance, int on_sort_compare(const Gtk::TreeModel::iterator& a, const Gtk::TreeModel::iterator& b);
Definition at line 209 of file treesortable.h.
◆ anonymous enum
◆ TreeSortable()
Gtk::TreeSortable::TreeSortable |
( |
| ) |
|
|
protected |
You should derive from this class to use it.
◆ ~TreeSortable()
virtual Gtk::TreeSortable::~TreeSortable |
( |
| ) |
|
|
virtual |
◆ add_interface()
static void Gtk::TreeSortable::add_interface |
( |
GType |
gtype_implementer | ) |
|
|
static |
◆ get_sort_column_id()
bool Gtk::TreeSortable::get_sort_column_id |
( |
int & |
sort_column_id, |
|
|
SortType & |
order |
|
) |
| const |
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::TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID or Gtk::TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID.
- Parameters
-
sort_column_id | The sort column id to be filled in. |
order | The Gtk::SortType to be filled in. |
- Returns
true
if the sort column is not one of the special sort column ids.
◆ get_sort_column_id_vfunc()
virtual bool Gtk::TreeSortable::get_sort_column_id_vfunc |
( |
int * |
sort_column_id, |
|
|
SortType * |
order |
|
) |
| const |
|
protectedvirtual |
◆ get_type()
static GType Gtk::TreeSortable::get_type |
( |
| ) |
|
|
static |
Get the GType for this class, for use with the underlying GObject type system.
◆ gobj() [1/2]
Provides access to the underlying C GObject.
Definition at line 129 of file treesortable.h.
◆ gobj() [2/2]
Provides access to the underlying C GObject.
Definition at line 132 of file treesortable.h.
◆ has_default_sort_func()
bool Gtk::TreeSortable::has_default_sort_func |
( |
| ) |
const |
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
true
, if the model has a default sort function.
◆ has_default_sort_func_vfunc()
virtual bool Gtk::TreeSortable::has_default_sort_func_vfunc |
( |
| ) |
const |
|
protectedvirtual |
◆ on_sort_column_changed()
virtual void Gtk::TreeSortable::on_sort_column_changed |
( |
| ) |
|
|
protectedvirtual |
◆ set_default_sort_func()
void Gtk::TreeSortable::set_default_sort_func |
( |
const SlotCompare & |
slot | ) |
|
Sets the default comparison function used when sorting. If the current sort column id of sortable is DEFAULT_SORT_COLUMN_ID, then the model will sort using this function. See also unset_default_sort_func().
- Parameters
-
◆ set_default_sort_func_vfunc()
virtual void Gtk::TreeSortable::set_default_sort_func_vfunc |
( |
GtkTreeIterCompareFunc |
func, |
|
|
void * |
data, |
|
|
GDestroyNotify |
destroy |
|
) |
| |
|
protectedvirtual |
◆ set_sort_column() [1/2]
Sets the current sort column to be sort_column_id. The sortable will resort itself to reflect this change, after emitting a Gtk::TreeSortable::signal_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
- Parameters
-
sort_column_id | The sort column id to set. |
order | The sort order of the column. |
◆ set_sort_column() [2/2]
void Gtk::TreeSortable::set_sort_column |
( |
int |
sort_column_id, |
|
|
SortType |
order |
|
) |
| |
Sets the current sort column to be sort_column_id. The sortable will resort itself to reflect this change, after emitting a Gtk::TreeSortable::signal_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
- Parameters
-
sort_column_id | The sort column id to set. |
order | The sort order of the column. |
◆ set_sort_column_id() [1/2]
◆ set_sort_column_id() [2/2]
void Gtk::TreeSortable::set_sort_column_id |
( |
int |
sort_column_id, |
|
|
SortType |
order |
|
) |
| |
◆ set_sort_column_id_vfunc()
virtual void Gtk::TreeSortable::set_sort_column_id_vfunc |
( |
int |
sort_column_id, |
|
|
SortType |
order |
|
) |
| |
|
protectedvirtual |
◆ set_sort_func() [1/2]
Sets the comparison function used when sorting a certain column. If the current sort column is the same as sort_column, then the model will sort using this function.
- Parameters
-
sort_column | the sort column to set the function for |
slot | The sorting slot callback. |
◆ set_sort_func() [2/2]
void Gtk::TreeSortable::set_sort_func |
( |
int |
sort_column_id, |
|
|
const SlotCompare & |
slot |
|
) |
| |
Sets the comparison function used when sorting a certain column. If the current sort column id is the same as sort_column_id, then the model will sort using this function.
- Parameters
-
sort_column_id | the sort column id to set the function for |
slot | The sorting slot callback. |
◆ set_sort_func_vfunc()
virtual void Gtk::TreeSortable::set_sort_func_vfunc |
( |
int |
sort_column_id, |
|
|
GtkTreeIterCompareFunc |
func, |
|
|
void * |
data, |
|
|
GDestroyNotify |
destroy |
|
) |
| |
|
protectedvirtual |
◆ signal_sort_column_changed()
Glib::SignalProxy0< void > Gtk::TreeSortable::signal_sort_column_changed |
( |
| ) |
|
- Slot Prototype:
void on_my_sort_column_changed()
◆ sort_column_changed()
void Gtk::TreeSortable::sort_column_changed |
( |
| ) |
|
◆ sort_column_changed_vfunc()
virtual void Gtk::TreeSortable::sort_column_changed_vfunc |
( |
| ) |
const |
|
protectedvirtual |
◆ unset_default_sort_func()
void Gtk::TreeSortable::unset_default_sort_func |
( |
| ) |
|
Sets the default comparison function used when sorting. See set_default_sort_func().
After calling this method 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 DEFAULT_SORT_COLUMN_ID, the model will be unsorted.
◆ wrap()
A Glib::wrap() method for this object.
- Parameters
-
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |
- Returns
- A C++ instance that wraps this C instance.
The documentation for this class was generated from the following file: