Checkbuttons |
||||||||
A checkbutton is a menu entry which has an “on” and an “off” state. The state is stored in a Tcl/Tk variable. We gain access to this variable by the functions First, there comes a sepator: (edit-menu 'add 'separator) We create an unique name and bind it to the symbol (define brightness-var (gensym)) Then, we add the checkbutton: (edit-menu 'add 'checkbutton #:label 'bright #:command (lambda () (print (get-tk-var brightness-var))) #:variable (tk-var brightness-var))
You can always read the Tcl/Tk variable: (get-tk-var brightness-var) |