button cget
Gives the value of an option of the button.
PATHNAME cget OPTION
Description
Gives the value of OPTION, with its full name. With no value from the script, the value is the value of the theme or the default of the option database. A short form such as -bg works.
Returns
The value of the option.
Examples
% button .cg -text Save
> .cg cget -text
Save
% button .cg2 -fg red
> .cg2 cget -fg
red
Errors
% button .cg3; .cg3 cget -tex
unknown option "-tex"
-errorcode TK LOOKUP OPTION -tex
% button .cg4; .cg4 cget
wrong # args: should be ".cg4 cget option"
-errorcode TCL WRONGARGS
Facts
- Capability
- None.
- Tcl release
- Tcl 9.1 and 8.6.
- Since
- ztk 1.0.0-beta.1