1ttk::combobox(n) Tk Themed Widget ttk::combobox(n)
2
3
4
5______________________________________________________________________________
6
8 ttk::combobox - text field with popdown selection list
9
11 ttk::combobox pathName ?options?
12_________________________________________________________________
13
15 A ttk::combobox combines a text field with a pop-down list of values;
16 the user may select the value of the text field from among the values
17 in the list.
18
20 -class -cursor -takefocus
21 -style
22
23 See the ttk_widget manual entry for details on the standard options.
24
26 [-exportselection exportSelection] Boolean value. If set, the widget
27 selection is linked to the X selection. [-justify justify] Specifies
28 how the text is aligned within the widget. Must be one of left, cen‐
29 ter, or right. [-height height] Specifies the height of the pop-down
30 listbox, in rows. [-postcommand postCommand] A Tcl script to evaluate
31 immediately before displaying the listbox. The -postcommand script may
32 specify the -values to display. [-state state] One of normal, read‐
33 only, or disabled. In the readonly state, the value may not be edited
34 directly, and the user can only select one of the -values from the
35 dropdown list. In the normal state, the text field is directly
36 editable. In the disabled state, no interaction is possible.
37 [-textvariable textVariable] Specifies the name of a variable whose
38 value is linked to the widget value. Whenever the variable changes
39 value the widget value is updated, and vice versa. [-values values]
40 Specifies the list of values to display in the drop-down listbox.
41 [-width width] Specifies an integer value indicating the desired width
42 of the entry window, in average-size characters of the widget's font.
43
45 The following subcommands are possible for combobox widgets:
46
47 pathName current ?newIndex?
48 If newIndex is supplied, sets the combobox value to the element
49 at position newIndex in the list of -values. Otherwise, returns
50 the index of the current value in the list of -values or -1 if
51 the current value does not appear in the list.
52
53 pathName get
54 Returns the current value of the combobox.
55
56 pathName set value
57 Sets the value of the combobox to value.
58
59 The combobox widget also supports the following ttk::entry widget sub‐
60 commands (see ttk::entry(n) for details):
61 bbox delete icursor
62 index insert selection xview The combobox
63 widget also supports the following generic ttk::widget widget subcom‐
64 mands (see ttk::widget(n) for details): cget config‐
65 ure identify instate state
66
68 The combobox widget generates a <<ComboboxSelected>> virtual event when
69 the user selects an element from the list of values. If the selection
70 action unposts the listbox, this event is delivered after the listbox
71 is unposted.
72
74 ttk::widget(n), ttk::entry(n)
75
77 choice, entry, list box, text box, widget
78
79
80
81Tk 8.5 ttk::combobox(n)