You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The (selection) and (selection!) functions handle the details of selection management for listboxes, checkboxes, toggle buttons, combo boxes, tables, etc. To get the current selection, just pass a widget (or something convertible to a widget) to (selection). It will always return the selected value, or nil if there is no selection:
Pass nil to clear the selection. Like with (selection), use the multi? option to interpret the new selection value as a list of values to select.
Text Selection
The selection of text widgets is also handled by the (selection) and (selection!) functions. As above, if the selection is empty, nil is returned. Otherwise, a vector with the start and end positions of the selection range will be returned.
Selection is sometimes, but not always, the same as the "value" of a widget. See Widget Value for more info.