The methods shown here are available on all the ttk widgets.
This method returns the value for the specified
To set one or more widget options, use keyword
arguments of the form
. For example, to set a
font, you might use an
argument such as “
If you provide no arguments, the method will return a
dictionary of all the widget's current option values. In
this dictionary, the keys will be the option names, and
each related value will be a tuple
||The option name.|
||The database name of the option.|
||The database class of the option.|
||The default value of the option.|
||The current value of the option.|
Use this to determine what element is at a given
location within the widget. If the point
( relative to the widget is
somewhere within the widget, this method returns
the name of the element at that position; otherwise
it returns an empty string.
stateSpec, callback=None, *args, **kw)
The purpose of this to determine whether the widget is in a specified state or combination of states.
If you provide a callable value as the
callback argument, and the widget matches
the state or combination of states specified by the
argument, that callable will be called with
*args and keyword
**kw. If the widget's state
does not match
callback will not be called.
If you don't provide a
argument, the method will return
if the widget's state matches
For the structure of the
argument, see Section 46.1, “Specifying widget states in ttk”.
Use this item either to query a widget to determine its current states, or to set or clear one state.
If you provide a
of the form described in Section 46.1, “Specifying widget states in ttk”, the method will set or
clear states in the widget according to that
For example, for a widget
w.state(['!disabled', 'selected']) would clear the widget's
set and set its
Several methods within ttk require a
that specifies a particular widget state or combination
of states. This argument may be any of the following:
A single state name such as
ttk.Button widget is in this state,
for example, when the mouse cursor is over the button
and mouse button 1 is down.
A single state name preceded with an exclamation
!); this matches the widget
state only when that state is off.
For example, a
'!pressed' specifies a widget that is not
currently being pressed.
A sequence of state names, or state names preceded by
'!'. Such a
matches only when
all of its components match. For example, a
('!disabled', 'focus') matches a
widget only when that widget is not disabled and it