![]() |
![]() |
Inheritance diagram for Gtk::TreeSelection:
Public Types | |
typedef SigC::Slot3< bool, const Glib::RefPtr<TreeModel>&, const TreeModel::Path&, bool > | SlotSelect |
typedef SigC::Slot1< void, const TreeModel::iterator& > | SlotForeachIter |
typedef SigC::Slot1< void, const TreeModel::Path& > | SlotForeachPath |
Public Methods | |
virtual | ~TreeSelection () |
GtkTreeSelection* | gobj () |
const GtkTreeSelection* | gobj () const |
GtkTreeSelection* | gobj_copy () |
void | set_mode (SelectionMode type) |
Sets the selection mode of the selection. | |
SelectionMode | get_mode () const |
Gets the selection mode for selection. | |
void | set_select_function (const SlotSelect& slot) |
TreeView* | get_tree_view () |
Returns the tree view associated with selection. | |
const TreeView* | get_tree_view () const |
Returns the tree view associated with selection. | |
Glib::RefPtr<TreeModel> | get_model () |
Shortcut for get_tree_view()->get_model(). | |
Glib::RefPtr<const TreeModel> | get_model () const |
TreeModel::iterator | get_selected () |
Get the currently selected row. | |
TreeModel::iterator | get_selected (Glib::RefPtr<TreeModel>& model) |
Get the currently selected row. | |
void | selected_foreach (const SlotForeachIter& slot) |
void | selected_foreach (const SlotForeachPath& slot) |
void | select (const TreeModel::Path& path) |
Select the row at path. | |
void | select (const TreeModel::iterator& iter) |
Selects the specified iterator. | |
void | select (const TreeModel::Row& row) |
Selects the specified iterator. | |
void | select (const TreeModel::Path& start_path, const TreeModel::Path& end_path) |
Selects a range of nodes, determined by start_path and end_path inclusive. | |
void | unselect (const TreeModel::Path& path) |
Unselects the row at path. | |
void | unselect (const TreeModel::iterator& iter) |
Unselects the specified iterator. | |
bool | is_selected (const TreeModel::Path& path) const |
Returns true if the row pointed to by path is currently selected. | |
bool | is_selected (const TreeModel::iterator& iter) const |
Returns true if the row pointed to by path is currently selected. | |
void | select_all () |
Selects all the nodes. | |
void | unselect_all () |
Unselects all the nodes. | |
Glib::SignalProxy0<void> | signal_changed () |
Protected Methods | |
virtual void | on_changed () |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr<Gtk::TreeSelection> | wrap (GtkTreeSelection* object, bool take_copy=false) |
This is a helper object to manage the selection for a Gtk::TreeView widget.
It is automatically created when a new Gtk::TreeView widget is created, and cannot exist independently of this widget. The primary reason this class exists is for cleanliness of code and API. That is, there is no conceptual reason all these methods could not be methods on the Gtk::TreeView widget instead of a separate class.
The Gtk::TreeSelection object can be obtained from a Gtk::TreeView by calling Gtk::TreeView::get_selection(). It can be manipulated to check the selection status of the tree, as well as to select and deselect individual rows. Selection is done completely view-side. As a result, multiple views of the same model can have completely different selections. Additionally, you cannot change the selection of a row on the model that is not currently displayed by the view without expanding its parents first.
When monitoring the selection of a view, it's important to remember that the "changed" signal is mostly a hint. That is, it may only emit one signal when a range of rows is selected. Additionally, it may on occasion emit a "changed" signal when nothing has happened.
|
|
|
|
|
|
|
|
|
Gets the selection mode for selection. See set_mode().
|
|
|
|
Shortcut for get_tree_view()->get_model().
|
|
Get the currently selected row.
|
|
Get the currently selected row.
|
|
Returns the tree view associated with selection.
|
|
Returns the tree view associated with selection.
|
|
Reimplemented from Glib::ObjectBase. |
|
Reimplemented from Glib::ObjectBase. |
|
|
|
Returns
|
|
Returns
If path does not point to a valid location,
|
|
|
|
Selects a range of nodes, determined by start_path and end_path inclusive.
|
|
Selects the specified iterator.
|
|
Selects the specified iterator.
|
|
Select the row at path.
|
|
Selects all the nodes. selection is must be set to Gtk::SELECTION_MULTIPLE mode. |
|
|
|
|
|
Sets the selection mode of the selection. If the previous type was Gtk::SELECTION_MULTIPLE, then the anchor is kept selected, if it was previously selected.
|
|
|
|
|
|
Unselects the specified iterator.
|
|
Unselects the row at path.
|
|
Unselects all the nodes.
|
|
|