tk_optionMenu |
||||
|
It contains as a child widget a menu the entries of which are bound to the Tcl/Tk variable represented by Together they allow the user to select one of the values given by the value arguments. The current value will be stored in the Tcl/Tk variable represented by Once a new value is selected, it will be stored in the variable and appear in the option menubutton. You can gain access to the child menu as in this example: (define button1 (tk 'create-widget "tk_optionMenu" (tk-var "globalOption") "alpha" "beta" "gamma")) (tk/pack button1) (define button1menu (tk-id->widget (tk/winfo children button1))) The current value of the variable can be read as in this example: (get-tk-var "globalOption") The current value can be changed by setting the variable as in this example:
|