Checkbutton Entries |
||||
|
A checkbutton menu entry behaves much like a checkbutton widget. When it is invoked it toggles back and forth between the selected and deselected states. When the entry is selected, a particular value is stored in a particular global variable (as determined by the #:onvalue and #:variable options for the entry); when the entry is deselected another value (determined by the #:offvalue option) is stored in the global variable. An indicator box is displayed to the left of the label in a checkbutton entry. If the entry is selected then the indicator's center is displayed in the color given by the #:selectcolor option for the entry; otherwise the indicator's center is displayed in the background color for the menu. If a #:command option is specified for a checkbutton entry, then its value is evaluated as a Tcl command each time the entry is invoked; this happens after toggling the entry's selected state. |