Package: gtk

Function gtk-tree-selection-selected

Lambda List

gtk-tree-selection-selected (selection)

Arguments

selection -- a gtk-tree-selection object

Return Value

The gtk-tree-iter iterator of the selected node, or nil if there is no selected node.

Details

Returns the iterator to the currently selected node if the selection mode is set to the values :single or :browse of the gtk-selection-mode enumeration. This function will not work if you use the selection mode :multiple.

Note

As a convenience the C implementation also gets the current model of the tree view wiget associated with the selection. Use the functions gtk-tree-selection-tree-view and gtk-tree-view-model instead to get the model.

Example

(let* ((model (gtk-tree-view-model view))
       (selection (gtk-tree-view-selection view))
       ;; This will only work in single or browse selection mode
       (iter (gtk-tree-selection-selected selection)))
  (if iter
      ;; A row is selected
      ...
      ;; No row is selected
      ...
  ... )    
 

See also

2021-2-27