If you set this option to an image, that image will appear in the checkbutton when it is set. The color of the checkbutton when it is set. You may set this option to any of the other styles With the default value, relief=FLAT, the checkbutton does not stand out from its background. How much space to leave above and below the checkbutton and text. How much space to leave to the left and right of the checkbutton and text. You can supply an alternate value for the on state by setting onvalue to that value.
Normally, a checkbutton's associated control variable will be set to 1 when it is set (on). You can supply an alternate value for the off state by setting offvalue to that value. Normally, a checkbutton's associated control variable will be set to 0 when it is cleared (off). If the text contains multiple lines, this option controls how the text is justified: CENTER, LEFT, or RIGHT. To display a graphic image on the button. The color of the focus highlight when the checkbutton has the focus. The number of lines of text on the checkbutton. The default is a stippled version of the default foreground color. The foreground color used to render the text of a disabled checkbutton. If you set this option to a cursor name ( arrow, dot etc.), the mouse cursor will change to that pattern when it is over the checkbutton. Default is 2 pixels.Ī procedure to be called every time the user changes the state of this checkbutton. The size of the border around the indicator. To display a monochrome image on a button.
The normal background color displayed behind the label and indicator. These options can be used as key-value pairs separated by commas.īackground color when the checkbutton is under the cursor.įoreground color when the checkbutton is under the cursor. Options − Here is the list of most commonly used options for this widget. Master − This represents the parent window. Here is the simple syntax to create this widget −
You can also display images in place of text. The user can then select one or more options by clicking the button corresponding to each option. The Checkbutton widget is used to display a number of options to a user as toggle buttons.