![]() |
![]() |
Public Types | |
enum | { DEFAULT_SORT_COLUMN_ID = -1, DEFAULT_UNSORTED_COLUMN_ID = -2 } |
typedef sigc::slot< int, const Gtk::TreeModel::iterator&, const Gtk::TreeModel::iterator& > | SlotCompare |
This callback should return -1 if a compares before b, 0 if they compare equal, 1 if a compares after b. | |
Public Member Functions | |
bool | 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. | |
const GtkTreeSortable* | gobj () const |
Provides access to the underlying C GObject. | |
GtkTreeSortable* | gobj () |
Provides access to the underlying C GObject. | |
bool | has_default_sort_func () const |
Returns true if the model has a default sort function. | |
void | set_default_sort_func (const SlotCompare& slot) |
Sets the default comparison function used when sorting. | |
void | set_sort_column (int sort_column_id, SortType order) |
Sets the current sort column to be sort_column_id . | |
void | set_sort_column (const TreeModelColumnBase& sort_column_id, SortType order) |
Sets the current sort column to be sort_column_id . | |
void | set_sort_column_id (int sort_column_id, SortType order) |
void | set_sort_column_id (const TreeModelColumnBase& sort_column_id, SortType order) |
void | set_sort_func (int sort_column_id, const SlotCompare& slot) |
Sets the comparison function used when sorting a certain column. | |
void | set_sort_func (const TreeModelColumnBase& sort_column, const SlotCompare& slot) |
Sets the comparison function used when sorting a certain column. | |
Glib::SignalProxy0<void> | signal_sort_column_changed () |
void | sort_column_changed () |
Emits a GtkTreeSortable::sort_column_changed signal on. | |
void | unset_default_sort_func () |
Sets the default comparison function used when sorting. | |
virtual | ~TreeSortable () |
Static Public Member Functions | |
static void | add_interface (GType gtype_implementer) |
Protected Member Functions | |
virtual bool | get_sort_column_id_vfunc (int* sort_column_id, SortType* order) const |
virtual bool | has_default_sort_func_vfunc () const |
virtual void | on_sort_column_changed () |
virtual void | set_default_sort_func_vfunc (GtkTreeIterCompareFunc func, void* data, GtkDestroyNotify destroy) |
virtual void | set_sort_column_id_vfunc (int sort_column_id, SortType order) |
virtual void | set_sort_func_vfunc (int sort_column_id, GtkTreeIterCompareFunc func, void* data, GtkDestroyNotify destroy) |
virtual void | sort_column_changed_vfunc () const |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr<Gtk::TreeSortable> | wrap (GtkTreeSortable* object, bool take_copy=false) |
|
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); |
|
|
|
|
|
|
|
Fills in sort_column_id and order with the current sort column and the order.
It returns
|
|
|
|
Provides access to the underlying C GObject.
Reimplemented from Glib::Interface. Reimplemented in Gtk::ListStore, Gtk::TreeModelSort, and Gtk::TreeStore. |
|
Provides access to the underlying C GObject.
Reimplemented from Glib::Interface. Reimplemented in Gtk::ListStore, Gtk::TreeModelSort, and Gtk::TreeStore. |
|
Returns This is used primarily by GtkTreeViewColumns in order to determine if a model can go back to the default state, or not.
|
|
|
|
|
|
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().
|
|
|
|
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. If sort_column_id is Gtk::TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, then the default sort function will be used, if it is set.
|
|
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. If sort_column_id is Gtk::TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, then the default sort function will be used, if it is set.
|
|
|
|
|
|
|
|
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.
|
|
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.
|
|
|
|
|
|
Emits a GtkTreeSortable::sort_column_changed signal on.
|
|
|
|
Sets the default comparison function used when sorting. 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. |
|
|