ttk::spinbox selection
Gives, sets, or clears the selected text of the field.
PATHNAME selection clear
PATHNAME selection present
PATHNAME selection range START END
PATHNAME selection from INDEX
PATHNAME selection to INDEX
PATHNAME selection adjust INDEX
PATHNAME selection element ?ELEMENT?
Description
clear clears the selection. present gives 1 when the field has selected text, else 0. range selects the characters from START up to the character before END.
from sets the anchor of the selection at INDEX. to selects from the anchor to INDEX. adjust moves the end of the selection that is nearer to INDEX to INDEX. element gives the selected arrow element, or none, and with ELEMENT it sets it.
Returns
An empty string, or 1 or 0 for present.
Examples
% ttk::spinbox .tsbse
> .tsbse insert 0 hello
> .tsbse selection range 1 3
> list [.tsbse selection present] [.tsbse index sel.first] [.tsbse index sel.last]
1 1 3
% ttk::spinbox .tsbse4
> .tsbse4 selection element
none
% .tsbse selection clear
> .tsbse selection present
0
Errors
% ttk::spinbox .tsbse2; .tsbse2 selection range 0
wrong # args: should be ".tsbse2 selection range start end"
-errorcode NONE
% ttk::spinbox .tsbse3; .tsbse3 selection bogus
bad selection option "bogus": must be adjust, clear, element, from, present, range, or to
-errorcode NONE
Facts
- Capability
- None.
- Tcl release
- Tcl 9.1 and 8.6.
- Since
- ztk 1.0.0-beta.1