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.

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* ((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
      ...
  ... )    

Warning

The gtk:tree-selection implementation is deprecated since 4.10. Please do not use it in newly written code.
 

See also

#2024-11-5