gtk.tree_selection
Module for [TreeSelection] class
Types 3
The #GtkTreeSelection object is a helper object to manage the selection for a #GtkTreeView widget. The #GtkTreeSelection object is automatically created when a new #GtkTreeView widget is created, and cannot exist independently of this widget. The primary reason the #GtkTreeSelection objects exists is for cleanliness of code and API. That is, there is no conceptual reason all these functions could not be methods on the #GtkTreeView widget instead of a separate function.
The #GtkTreeSelection object is gotten from a #GtkTreeView by calling gtk.tree_view.TreeView.getSelection. It can be manipulated to check the selection status of the tree, as well as 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.
One of the important things to remember when monitoring the selection of a view is that the #GtkTreeSelection::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 #GtkTreeSelection::changed signal when nothing has happened (mostly as a result of programmers calling select_row on an already selected row).
TreeSelectionGidBuilder builder() static nothrowGet builder for [gtk.tree_selection.TreeSelection] Returns: New builder objectgtk.types.SelectionMode mode() @property nothrowGet `mode` property. Returns: Selection mode. See [gtk.tree_selection.TreeSelection.setMode] for more information on this property.void mode(gtk.types.SelectionMode propval) @property nothrowSet `mode` property. Params: propval = Selection mode. See [gtk.tree_selection.TreeSelection.setMode] for more information on this property.int countSelectedRows() nothrowReturns the number of rows that have been selected in tree. Returns: The number of rows selected.gtk.types.SelectionMode getMode() nothrowGets the selection mode for selection. See [gtk.tree_selection.TreeSelection.setMode]. Returns: the current selection modebool getSelected(out gtk.tree_model.TreeModel model, out gtk.tree_iter.TreeIter iter) nothrowSets iter to the currently selected node, if selection is set to [gtk.types.SelectionMode.Single] or [gtk.types.SelectionMode.Browse].gtk.tree_path.TreePath[] getSelectedRows(out gtk.tree_model.TreeModel model) nothrowCreates a list of path of all selected rows.gtk.tree_view.TreeView getTreeView() nothrowReturns the tree view associated with selection. Returns: A #GtkTreeViewbool iterIsSelected(gtk.tree_iter.TreeIter iter) nothrowReturns true if the row at iter is currently selected.bool pathIsSelected(gtk.tree_path.TreePath path) nothrowReturns true if the row pointed to by path is currently selected. If path does not point to a valid location, false is returnedvoid selectAll() nothrowSelects all the nodes. selection must be set to #GTK_SELECTION_MULTIPLE mode.void selectRange(gtk.tree_path.TreePath startPath, gtk.tree_path.TreePath endPath) nothrowSelects a range of nodes, determined by start_path and end_path inclusive. selection must be set to #GTK_SELECTION_MULTIPLE mode.void selectedForeach(gtk.types.TreeSelectionForeachFunc func) nothrowCalls a function for each selected node. Note that you cannot modify the tree or selection from within this function. As a result, [gtk.tree_selection.TreeSelection.getSelectedRows] might be more u...void setMode(gtk.types.SelectionMode type) nothrowSets 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.void unselectRange(gtk.tree_path.TreePath startPath, gtk.tree_path.TreePath endPath) nothrowUnselects a range of nodes, determined by start_path and end_path inclusive.gulong connectChanged(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.tree_selection.TreeSelection)))
&& Parameters!T.length < 2) nothrowConnect to `Changed` signal.Fluent builder implementation template for gtk.tree_selection.TreeSelection
T mode(gtk.types.SelectionMode propval) nothrowSet `mode` property. Params: propval = Selection mode. See [gtk.tree_selection.TreeSelection.setMode] for more information on this property. Returns: Builder instance for fluent chainingFluent builder for gtk.tree_selection.TreeSelection