|
Graphics.UI.Gtk.ModelView.TreeSelection | Portability | portable (depends on GHC) | Stability | provisional | Maintainer | gtk2hs-users@lists.sourceforge.net |
|
|
|
|
|
Description |
The selection object for TreeView
|
|
Synopsis |
|
|
|
|
Detail
|
|
The TreeSelection object is a helper object to manage the selection for
a TreeView widget. The TreeSelection object is automatically created
when a new TreeView widget is created, and cannot exist independentally of
this widget. The primary reason the TreeSelection 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 TreeView widget instead of a
separate function.
The TreeSelection object is gotten from a TreeView by calling
treeViewGetSelection. It can be
manipulated to check the selection status of the tree, as well as select
and deselect individual rows. Selection is done completely on the
TreeView 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 "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 (mostly as a
result of programmers calling select_row on an already selected row).
|
|
Class Hierarchy
|
|
| GObject
| +----TreeSelection
|
|
Types
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Mode in which selections can be performed
- There is a deprecated entry SelectionExtended which should have the same
value as SelectionMultiple. C2HS chokes on that construct.
| Constructors | SelectionNone | | SelectionSingle | | SelectionBrowse | | SelectionMultiple | |
|
|
|
|
Callback type for a function that is called everytime the selection
changes. This function is set with treeSelectionSetSelectFunction.
|
|
|
Callback function type for treeSelectionSelectedForeach.
|
|
Methods
|
|
|
Set single or multiple choice.
|
|
|
Gets the selection mode.
|
|
|
Set a callback function if selection changes.
- If set, this function is called before any
node is selected or unselected, giving some control over which nodes are
selected. The select function should return True if the state of the node
may be toggled, and False if the state of the node should be left
unchanged.
|
|
|
Retrieve the TreeView widget that this TreeSelection works on.
|
|
|
Retrieves the selection of a single choice TreeSelection.
|
|
|
Execute a function for each selected node.
|
|
treeSelectionGetSelectedRows | Source |
|
:: TreeSelectionClass self | | => self | returns a list containing a TreePath for
each selected row.
| -> IO [TreePath] | | Creates a list of paths of all selected rows.
- Additionally, if you are
planning on modifying the model after calling this function, you may want to
convert the returned list into a list of TreeRowReferences. To do this,
you can use treeRowReferenceNew.
- Available since Gtk+ version 2.2
|
|
|
treeSelectionCountSelectedRows | Source |
|
:: TreeSelectionClass self | | => self | returns The number of rows selected.
| -> IO Int | | Returns the number of rows that are selected.
- Available since Gtk+ version 2.2
|
|
|
|
Select a specific item by TreePath.
|
|
|
Deselect a specific item by TreePath.
|
|
|
Returns True if the row at the given path is currently selected.
|
|
|
Select a specific item by TreeIter.
|
|
|
Deselect a specific item by TreeIter.
|
|
|
Returns True if the row at the given iter is currently selected.
|
|
|
Selects all the nodes. The tree selection must be set to
SelectionMultiple mode.
|
|
|
Unselects all the nodes.
|
|
treeSelectionSelectRange | Source |
|
|
|
treeSelectionUnselectRange | Source |
|
:: TreeSelectionClass self | | => self | startPath - The initial node of the range.
| -> TreePath | endPath - The initial node of the range.
| -> TreePath | | -> IO () | | Unselects a range of nodes, determined by startPath and endPath
inclusive.
- Available since Gtk+ version 2.2
|
|
|
Attributes
|
|
|
'mode' property. See treeSelectionGetMode and treeSelectionSetMode
|
|
Signals
|
|
|
|
|
Emitted whenever the selection has (possibly) changed. Please note that
this signal is mostly a hint. It may only be emitted once when a range of
rows are selected, and it may occasionally be emitted when nothing has
happened.
|
|
Produced by Haddock version 2.6.0 |