beetlebug▾
/

option get

Gives the value of the option database for an option of a window.

option get WINDOW NAME CLASS

Description

Looks up the option with the database name NAME and the database class CLASS for WINDOW, with the rules of the patterns and the priorities. The result is an empty string when no entry matches.

Returns

The value of the best entry, or an empty string.

Examples

% option add *Button.background yellow
> button .g
> option get .g background Background
yellow

% button .g2
> option get .g2 cursor Cursor

Errors

% option get .nope a A
bad window path name ".nope"
-errorcode NONE

% option get .
wrong # args: should be "option get window name class"
-errorcode TCL WRONGARGS

Facts

Capability
None.
Tcl release
Tcl 9.1 and 8.6.
Since
ztk 1.0.0-beta.1

See also