1tk_optionMenu(n) Tk Built-In Commands tk_optionMenu(n)
2
3
4
5______________________________________________________________________________
6
8 tk_optionMenu - Create an option menubutton and its menu
9
11 tk_optionMenu w varName value ?value value ...?
12_________________________________________________________________
13
14
16 This procedure creates an option menubutton whose name is w, plus an
17 associated menu. Together they allow the user to select one of the
18 values given by the value arguments. The current value will be stored
19 in the global variable whose name is given by varName and it will also
20 be displayed as the label in the option menubutton. The user can click
21 on the menubutton to display a menu containing all of the values and
22 thereby select a new value. Once a new value is selected, it will be
23 stored in the variable and appear in the option menubutton. The cur‐
24 rent value can also be changed by setting the variable.
25
26 The return value from tk_optionMenu is the name of the menu associated
27 with w, so that the caller can change its configuration options or
28 manipulate it in other ways.
29
30
32 option menu
33
34
35
36Tk 4.0 tk_optionMenu(n)