The table uses the resource name for the attributes, which has capitals at internal word boundaries. In Tcl commands, the attributes are specified with a dash and they are all lowercase. Compare:
The first command defines a resource database entry that covers all menubuttons and gives them a red active background. This only affects menubuttons created after the database entry is added. The second command changes an existing menubutton (.mb) to have a red active background. Note the difference in capitalization of background in the two commands. The resource database is introduced on page 372, and Chapter 31 explains how to use the resource database in more detail.
Table 30-1. Resource names of attributes for all button widgets
activeBackground | Background color when the mouse is over the button. |
activeForeground | Text color when the mouse is over the button. |
anchor | Anchor point for positioning the text. |
background | The normal background color. |
bitmap | A bitmap to display instead of text. |
borderWidth | Width of the border around the button. |
command | Tcl command to invoke when button is clicked. |
compound | Where the image or bitmap should be placed relative to the text: bottom, center, left, right, top or none (default). (Tk 8.4) |
cursor | Cursor to display when mouse is over the widget. |
default | active displays as a default button. normal and disabled display as normal button. See page 809 (Tk 8.0). |
direction | up, down, left, right, active. Offset direction for posting menus. menubutton. (Tk 8.0). |
disabledForeground | Foreground (text) color when button is disabled. |
font | Font for the text. |
foreground | Foreground (text) color. (Also fg). |
height | Height, in lines for text, or screen units for images. |
highlightBackground | Focus highlight color when widget does not have focus. |
highlightColor | Focus highlight color when widget has focus. |
highlightThickness | Width of highlight border. |
image | Image to display instead of text or bitmap. |
indicatorOn | Boolean that controls if the indicator is displayed.
checkbutton, menubutton, and radiobutton. |
justify | Text justification: center, left, or right. |
menu | Menu posted when menubutton is clicked. |
offRelief | Alternate relief style when the widget is deselected. checkbutton and radiobutton. (Tk 8.4) |
offValue | Value for Tcl variable when checkbutton is not selected. |
onValue | Value for Tcl variable when checkbutton is selected. |
overRelief | Alternate relief style when mouse is over the widget. button, checkbutton, and radiobutton. (Tk 8.4) |
padX | Extra space to the left and right of the button text. |
padY | Extra space above and below the button text. |
relief | flat, sunken, raised, groove, solid or ridge. |
repeatDelay | The number of milliseconds a button or key must be held down before it begins to auto-repeat. For button only. (Tk 8.4) |
repeatInterval | The number of milliseconds between auto-repeats. For button only. (Tk 8.4) |
selectColor | Color for selector. checkbutton or radiobutton. |
selectImage | Alternate graphic image for selector:
checkbutton or radiobutton. |
state | normal (enabled), disabled (deactivated), or active (when the mouse pointer is over the button). |
takeFocus | Control focus changes from keyboard traversal. |
text | Text to display in the button. |
textVariable | Tcl variable that has the value of the text. |
underline | Index of text character to underline. |
value | Value for Tcl variable when radiobutton is selected. |
variable | Tcl variable associated with the button: checkbutton or radiobutton. |
width | Width in characters for text, or screen units for image. As of Tk 8.4, on Windows only, a negative value is treated as a minimum width for button widgets only. |
wrapLength | Maximum character length before text is wrapped, in screen units. |