gtkmm 3.24.7
|
Thist is a list model for use with a Gtk::TreeView widget. More...
#include <gtkmm/liststore.h>
Public Member Functions | |
ListStore (ListStore && src) noexcept | |
ListStore & | operator= (ListStore && src) noexcept |
~ListStore () noexcept override | |
GtkListStore * | gobj () |
Provides access to the underlying C GObject. More... | |
const GtkListStore * | gobj () const |
Provides access to the underlying C GObject. More... | |
GtkListStore * | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More... | |
void | set_column_types (const TreeModelColumnRecord & columns) |
iterator | erase (const iterator & iter) |
Removes the given row from the list store. More... | |
iterator | insert (const iterator & iter) |
Creates a new row before the position. More... | |
iterator | insert_after (const iterator & iter) |
Creates a new row after the position. More... | |
iterator | prepend () |
Creates a new row at the start. More... | |
iterator | append () |
Creates a new row at the end. More... | |
void | iter_swap (const iterator & a, const iterator & b) |
Swaps a and b in store. More... | |
void | move (const iterator & source, const iterator & destination) |
Moves source to the position at destination. More... | |
void | reorder (const std::vector< int > & new_order) |
Reorders the list store to follow the order indicated by new_order. More... | |
void | clear () |
Removes all rows from the list store. More... | |
bool | iter_is_valid (const iterator & iter) const |
More... | |
![]() | |
TreeModel (TreeModel && src) noexcept | |
TreeModel & | operator= (TreeModel && src) noexcept |
~TreeModel () noexcept override | |
GtkTreeModel * | gobj () |
Provides access to the underlying C GObject. More... | |
const GtkTreeModel * | gobj () const |
Provides access to the underlying C GObject. More... | |
iterator | get_iter (const Path & path) |
Returns a valid iterator pointing to path. More... | |
iterator | get_iter (const Glib::ustring & path_string) |
Returns a valid iterator pointing to path_string. More... | |
Children | children () |
This returns an STL-like container API, for iterating over the rows. More... | |
Children | children () const |
This returns an STL-like container API, for iterating over the rows. More... | |
void | foreach_iter (const SlotForeachIter & slot) |
Calls a callback of type SlotForeachIter on each node in the model in a depth-first fashion. More... | |
void | foreach_path (const SlotForeachPath & slot) |
Calls a callback of type SlotForeachPath on each node in the model in a depth-first fashion. More... | |
void | foreach (const SlotForeachPathAndIter & slot) |
Calls a callback of type SlotForeachPathAndIter on each node in the model in a depth-first fashion. More... | |
TreeModelFlags | get_flags () const |
Returns a set of flags supported by this interface. More... | |
int | get_n_columns () const |
Returns the number of columns supported by tree_model. More... | |
GType | get_column_type (int index) const |
Returns the type of the column. More... | |
TreeModel::Path | get_path (const iterator & iter) const |
Returns a Gtk::TreePath referenced by iter. More... | |
void | row_changed (const Path & path, const iterator & iter) |
Emits the Gtk::TreeModel::signal_row_changed() signal on tree_model. More... | |
void | row_inserted (const Path & path, const iterator & iter) |
Emits the Gtk::TreeModel::signal_row_inserted() signal on tree_model. More... | |
void | row_has_child_toggled (const Path & path, const iterator & iter) |
Emits the Gtk::TreeModel::signal_row_has_child_toggled() signal on tree_model. More... | |
void | row_deleted (const Path & path) |
Emits the Gtk::TreeModel::signal_row_deleted() signal on tree_model. More... | |
void | rows_reordered (const Path & path, const iterator & iter, const std::vector< int > & new_order) |
Emits the "rows_reordered" signal on the tree model. More... | |
void | rows_reordered (const Path & path, const std::vector< int > & new_order) |
Emits the "rows_reordered" signal on the tree model. More... | |
void | rows_reordered (const Path & path, const iterator & iter, int * new_order) |
Emits the Gtk::TreeModel::signal_rows_reordered() signal on tree_model. More... | |
Glib::ustring | get_string (const iterator & iter) const |
Generates a string representation of the iter. More... | |
Glib::SignalProxy< void, const TreeModel::Path &, const TreeModel::iterator & > | signal_row_changed () |
Glib::SignalProxy< void, const TreeModel::Path &, const TreeModel::iterator & > | signal_row_inserted () |
Glib::SignalProxy< void, const TreeModel::Path &, const TreeModel::iterator & > | signal_row_has_child_toggled () |
Glib::SignalProxy< void, const TreeModel::Path & > | signal_row_deleted () |
Glib::SignalProxy< void, const TreeModel::Path &, const TreeModel::iterator &, int * > | signal_rows_reordered () |
![]() | |
TreeSortable (TreeSortable && src) noexcept | |
TreeSortable & | operator= (TreeSortable && src) noexcept |
~TreeSortable () noexcept override | |
GtkTreeSortable * | gobj () |
Provides access to the underlying C GObject. More... | |
const GtkTreeSortable * | gobj () const |
Provides access to the underlying C GObject. More... | |
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. More... | |
void | set_sort_column (const TreeModelColumnBase & sort_column_id, SortType order) |
Sets the current sort column to be sort_column_id. More... | |
void | set_sort_column (int sort_column_id, SortType order) |
Sets the current sort column to be sort_column_id. More... | |
void | set_sort_func (const TreeModelColumnBase & sort_column, const SlotCompare & slot) |
Sets the comparison function used when sorting a certain column. More... | |
void | set_sort_func (int sort_column_id, const SlotCompare & slot) |
Sets the comparison function used when sorting a certain column. More... | |
void | set_default_sort_func (const SlotCompare & slot) |
Sets the default comparison function used when sorting. More... | |
void | unset_default_sort_func () |
Sets the default comparison function used when sorting. More... | |
bool | has_default_sort_func () const |
Returns true if the model has a default sort function. More... | |
void | sort_column_changed () |
Emits a Gtk::TreeSortable::signal_sort_column_changed() signal on sortable. More... | |
Glib::SignalProxy< void > | signal_sort_column_changed () |
![]() | |
TreeDragSource (TreeDragSource && src) noexcept | |
TreeDragSource & | operator= (TreeDragSource && src) noexcept |
~TreeDragSource () noexcept override | |
GtkTreeDragSource * | gobj () |
Provides access to the underlying C GObject. More... | |
const GtkTreeDragSource * | gobj () const |
Provides access to the underlying C GObject. More... | |
bool | row_draggable (const TreeModel::Path & path) const |
Asks the Gtk::TreeDragSource whether a particular row can be used as the source of a DND operation. More... | |
bool | drag_data_get (const TreeModel::Path & path, SelectionData & selection_data) |
Asks the Gtk::TreeDragSource to fill in selection_data with a representation of the row at path. More... | |
bool | drag_data_delete (const TreeModel::Path & path) |
Asks the Gtk::TreeDragSource to delete the row at path, because it was moved somewhere else via drag-and-drop. More... | |
![]() | |
TreeDragDest (TreeDragDest && src) noexcept | |
TreeDragDest & | operator= (TreeDragDest && src) noexcept |
~TreeDragDest () noexcept override | |
GtkTreeDragDest * | gobj () |
Provides access to the underlying C GObject. More... | |
const GtkTreeDragDest * | gobj () const |
Provides access to the underlying C GObject. More... | |
bool | drag_data_received (const TreeModel::Path & dest, const SelectionData & selection_data) |
Asks the Gtk::TreeDragDest to insert a row before the path dest, deriving the contents of the row from selection_data. More... | |
bool | row_drop_possible (const TreeModel::Path & dest_path, const SelectionData & selection_data) const |
Determines whether a drop is possible before the given dest_path, at the same depth as dest_path. More... | |
![]() | |
Buildable (Buildable && src) noexcept | |
Buildable & | operator= (Buildable && src) noexcept |
~Buildable () noexcept override | |
GtkBuildable * | gobj () |
Provides access to the underlying C GObject. More... | |
const GtkBuildable * | gobj () const |
Provides access to the underlying C GObject. More... | |
void | set_name (const Glib::ustring & name) |
Sets the name of the buildable object. More... | |
Glib::ustring | get_name () const |
Gets the name of the buildable object. More... | |
Static Public Member Functions | |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. More... | |
static Glib::RefPtr< ListStore > | create (const TreeModelColumnRecord & columns) |
Instantiate a new ListStore. More... | |
![]() | |
static void | add_interface (GType gtype_implementer) |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. More... | |
![]() | |
static void | add_interface (GType gtype_implementer) |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. More... | |
![]() | |
static void | add_interface (GType gtype_implementer) |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. More... | |
![]() | |
static void | add_interface (GType gtype_implementer) |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. More... | |
![]() | |
static void | add_interface (GType gtype_implementer) |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. More... | |
Protected Member Functions | |
ListStore () | |
When using this constructor, you must use set_column_types() immediately afterwards. More... | |
ListStore (const TreeModelColumnRecord & columns) | |
void | set_value_impl (const iterator & row, int column, const Glib::ValueBase & value) override |
Override and implement this in a derived TreeModel class, so that Row::operator() and Row::set_value() work. More... | |
![]() | |
TreeModel () | |
You should derive from this class to use it. More... | |
virtual TreeModelFlags | get_flags_vfunc () const |
virtual int | get_n_columns_vfunc () const |
virtual GType | get_column_type_vfunc (int index) const |
virtual bool | iter_next_vfunc (const iterator & iter, iterator & iter_next) const |
Override and implement this in a derived TreeModel class. More... | |
virtual bool | get_iter_vfunc (const Path & path, iterator & iter) const |
Override and implement this in a derived TreeModel class. More... | |
virtual bool | iter_children_vfunc (const iterator & parent, iterator & iter) const |
Override and implement this in a derived TreeModel class. More... | |
virtual bool | iter_parent_vfunc (const iterator & child, iterator & iter) const |
Override and implement this in a derived TreeModel class. More... | |
virtual bool | iter_nth_child_vfunc (const iterator & parent, int n, iterator & iter) const |
Override and implement this in a derived TreeModel class. More... | |
virtual bool | iter_nth_root_child_vfunc (int n, iterator & iter) const |
Override and implement this in a derived TreeModel class. More... | |
virtual bool | iter_has_child_vfunc (const iterator & iter) const |
Override and implement this in a derived TreeModel class. More... | |
virtual int | iter_n_children_vfunc (const iterator & iter) const |
Override and implement this in a derived TreeModel class. More... | |
virtual int | iter_n_root_children_vfunc () const |
Override and implement this in a derived TreeModel class. More... | |
virtual void | ref_node_vfunc (const iterator & iter) const |
Override and implement this in a derived TreeModel class. More... | |
virtual void | unref_node_vfunc (const iterator & iter) const |
Override and implement this in a derived TreeModel class. More... | |
virtual TreeModel::Path | get_path_vfunc (const iterator & iter) const |
Override and implement this in a derived TreeModel class. More... | |
virtual void | get_value_vfunc (const iterator & iter, int column, Glib::ValueBase & value) const |
Override and implement this in a derived TreeModel class. More... | |
virtual void | set_value_impl (const iterator & row, int column, const Glib::ValueBase & value) |
Override and implement this in a derived TreeModel class, so that Row::operator() and Row::set_value() work. More... | |
virtual void | get_value_impl (const iterator & row, int column, Glib::ValueBase & value) const |
virtual void | on_row_changed (const TreeModel::Path & path, const TreeModel::iterator & iter) |
This is a default handler for the signal signal_row_changed(). More... | |
virtual void | on_row_inserted (const TreeModel::Path & path, const TreeModel::iterator & iter) |
This is a default handler for the signal signal_row_inserted(). More... | |
virtual void | on_row_has_child_toggled (const TreeModel::Path & path, const TreeModel::iterator & iter) |
This is a default handler for the signal signal_row_has_child_toggled(). More... | |
virtual void | on_row_deleted (const TreeModel::Path & path) |
This is a default handler for the signal signal_row_deleted(). More... | |
virtual void | on_rows_reordered (const TreeModel::Path & path, const TreeModel::iterator & iter, int * new_order) |
This is a default handler for the signal signal_rows_reordered(). More... | |
![]() | |
TreeSortable () | |
You should derive from this class to use it. More... | |
virtual bool | get_sort_column_id_vfunc (int * sort_column_id, SortType * order) const |
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, GDestroyNotify destroy) |
virtual void | set_default_sort_func_vfunc (GtkTreeIterCompareFunc func, void *data, GDestroyNotify destroy) |
virtual bool | has_default_sort_func_vfunc () const |
virtual void | sort_column_changed_vfunc () const |
virtual void | on_sort_column_changed () |
This is a default handler for the signal signal_sort_column_changed(). More... | |
![]() | |
TreeDragSource () | |
You should derive from this class to use it. More... | |
virtual bool | row_draggable_vfunc (const TreeModel::Path & path) const |
virtual bool | drag_data_get_vfunc (const TreeModel::Path & path, SelectionData & selection_data) const |
virtual bool | drag_data_delete_vfunc (const TreeModel::Path & path) |
![]() | |
TreeDragDest () | |
You should derive from this class to use it. More... | |
virtual bool | drag_data_received_vfunc (const TreeModel::Path & dest, const SelectionData & selection_data) |
virtual bool | row_drop_possible_vfunc (const TreeModel::Path & dest, const SelectionData & selection_data) const |
![]() | |
Buildable () | |
You should derive from this class to use it. More... | |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr< Gtk::ListStore > | wrap (GtkListStore * object, bool take_copy=false) |
A Glib::wrap() method for this object. More... | |
![]() | |
Glib::RefPtr< Gtk::TreeModel > | wrap (GtkTreeModel * object, bool take_copy=false) |
A Glib::wrap() method for this object. More... | |
![]() | |
Glib::RefPtr< Gtk::TreeSortable > | wrap (GtkTreeSortable * object, bool take_copy=false) |
A Glib::wrap() method for this object. More... | |
![]() | |
Glib::RefPtr< Gtk::TreeDragSource > | wrap (GtkTreeDragSource * object, bool take_copy=false) |
A Glib::wrap() method for this object. More... | |
![]() | |
Glib::RefPtr< Gtk::TreeDragDest > | wrap (GtkTreeDragDest * object, bool take_copy=false) |
A Glib::wrap() method for this object. More... | |
![]() | |
Glib::RefPtr< Gtk::Buildable > | wrap (GtkBuildable * object, bool take_copy=false) |
A Glib::wrap() method for this object. More... | |
Thist is a list model for use with a Gtk::TreeView widget.
It implements the Gtk::TreeModel interface, and also implements the Gtk::TreeSortable interface so you can sort the list using the view. Finally, it also implements the tree drag and drop interfaces.
|
noexcept |
|
overridenoexcept |
|
protected |
When using this constructor, you must use set_column_types() immediately afterwards.
This can be useful when deriving from this class, with a fixed TreeModelColumnRecord that is a member of the class. There is no create() method that corresponds to this constructor, because this constructor should only be used by derived classes.
|
explicitprotected |
iterator Gtk::ListStore::append | ( | ) |
Creates a new row at the end.
The row will be empty - to fill in values, you need to dereference the returned iterator and use Row::operator[] or Row::set_value(). See also insert() and prepend().
void Gtk::ListStore::clear | ( | ) |
Removes all rows from the list store.
|
static |
Removes the given row from the list store.
iter | The iterator to the row to be removed. |
|
static |
Get the GType for this class, for use with the underlying GObject type system.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
GtkListStore * Gtk::ListStore::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Creates a new row before the position.
If iter is end() then a new row will be appended to the list. The row will be empty - to fill in values, you need to dereference the returned iterator and use Row::operator[] or Row::set_value(). See also prepend() and append().
iter | An iterator to the row before which the new row will be inserted. |
Creates a new row after the position.
If iter is end() then a new row will be prepended to the list. The row will be empty - to fill in values, you need to dereference the returned iterator and use Row::operator[] or Row::set_value(). See also insert(), prepend() and append().
iter | An iterator to the row after which the new row will be inserted. |
bool Gtk::ListStore::iter_is_valid | ( | const iterator & | iter | ) | const |
This function is slow.
Only use it for debugging and/or testing purposes.
Checks if the given iter is a valid iter for this Gtk::ListStore.
iter | A Gtk::TreeIter. |
true
if the iter is valid, false
if the iter is invalid. Swaps a and b in store.
Note that this function only works with unsorted stores.
a | A Gtk::TreeIter. |
b | Another Gtk::TreeIter. |
Moves source to the position at destination.
Note that this function only works with unsorted stores.
source | The row that should be moved. |
destination | The position to move to. |
iterator Gtk::ListStore::prepend | ( | ) |
Creates a new row at the start.
The row will be empty - to fill in values, you need to dereference the returned iterator and use Row::operator[] or Row::set_value(). See also insert() and append().
void Gtk::ListStore::reorder | ( | const std::vector< int > & | new_order | ) |
Reorders the list store to follow the order indicated by new_order.
Note that this function only works with unsorted stores.
void Gtk::ListStore::set_column_types | ( | const TreeModelColumnRecord & | columns | ) |
|
overrideprotectedvirtual |
Override and implement this in a derived TreeModel class, so that Row::operator() and Row::set_value() work.
Your implementation of set_value_impl() should call row_changed() after changing the value.
Reimplemented from Gtk::TreeModel.
|
related |
A Glib::wrap() method for this object.
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. |