Common Widget Configuration Options
In the remainder of this chapter, we’ll discuss each widget, the commands used to create each widget, the options used to configure them, and the methods for manipulating them.
You’ll find that there are many, many configuration options shared by multiple widgets. We could list them individually for each widget, but in the interest of saving a tree or two, we will instead list the shared options up front rather than repeating them over and over. That way, we can concentrate on the options that are crucial to the behavior of each particular widget and save the reader from being lost in a sea of options.
The following options are supported by the widgets noted:
-activebackground =>colorSets the background color when the mouse cursor is over the widget. Applicable widgets: Button, Checkbutton, Menu, Menubutton, Optionmenu, Radiobutton, Scale, Scrollbar.
-activeborderwidth =>borderwidthSets a 3-D border around active elements. Applicable widgets: Menu, Menubutton, Optionmenu.
-activeforeground =>colorSets the text color when the mouse cursor is over the widget. Applicable widgets: Button, Checkbutton, Menu, Menubutton, Optionmenu, Radiobutton.
-anchor =>positionCauses the text to stick to that position in the widget. Values for
positionaren,ne,e,se,s,sw,w,nw, andcenter. Applicable widgets: Button, Checkbutton, Label, Menubutton, Optionmenu, Radiobutton.-background =>color-bg =>colorSets the background of the widget to the specified color. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access