The Checkbutton Widget
Create a checkbutton with the Checkbutton command. A checkbutton has an
indicator to the left of the label indicating whether the button is
selected. The boolean status of the button (0, 1, or
values as specified by the -onvalue
and -offvalue options) is stored in
the variable specified with the -variable option.
$parentwidget->Checkbutton (options)The standard configuration options that apply to Checkbutton are: -activeback-ground, -activeforeground, -anchor, -background, -bg, -bitmap, -borderwidth, -bd, -cursor, -disabledforeground, -font, -foreground, -fg, -height, -highlight-background, -highlightcolor, -highlightthickness, -image, -justify, -padx, -pady, -relief, -state, -takefocus, -underline, -width, and -wraplength.
Other options are:
-command =>callbackPointer to a function that will be called when the checkbutton is pressed.
-indicatoron =>booleanDetermines whether to display the indicator. Default is on (
1).-offvalue =>newvalueSpecifies the value used when the checkbutton is off. Must be a scalar. Default is
0.-onvalue =>newvalueSpecifies the value used when the checkbutton is on. Must be a scalar. Default is
1.-selectcolor =>colorColor of the indicator when the checkbutton is on.
-selectimage =>imgptrDefines the image to be displayed instead of text when the checkbutton is on. Ignored if
-imageis not used.-text =>'text'Defines the text string displayed in the checkbutton. See also
-textvariable.-textvariable =>\$variablePoints to the variable ...
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