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 :single or :browse values of the gtk:selection-mode enumeration. This function will not work if you use the :multiple selection mode.

Notes

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

Examples

(let* ((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

2024-3-14