1tixComboBox(n) Tix Built-In Commands tixComboBox(n)
2
3
4
6 tixComboBox - Create and manipulate tixComboBox widgets
7
9 tixComboBox pathName ?options?
10
12 The TixComboBox class is derived from the TixLabelWidget class and
13 inherits all the commands, options and subwidgets of its super-class.
14
16 TixComboBox supports all the standard options of a frame widget. See
17 the options(n) manual entry for details on the standard options.
18
20 [-anchor anchor] Specifies how the string inside the entry subwidget
21 should be aligned. Only the values "w" or "e" are allowed. When set
22 the "w", the entry is aligned to its beginning. When set to "e", it is
23 aligned to its end. [-arrowbitmap arrowBitmap] Specifies the bitmap to
24 be used in the arrow button beside the entry widget. The default is an
25 downward arrow bitmap in the file $tix_library/bitmaps/cbxarrow
26 [-browsecmd browseCmd] Specifies the command to be called when the user
27 browses through the listbox. This command can be used to provide
28 instant feedback when the user examines items in the listbox before
29 committing a choice. [-command command] Specifies the command to be
30 called when the ComboBox is invoked or when the -value of the ComboBox
31 is changed. [-crossbitmap crossBitmap] Specifies the bitmap to be used
32 in the "cross" button to the left of the entry widget. The default is a
33 bitmap in the file $tix_library/bitmaps/cross [-disablecallback dis‐
34 ableCallback] A boolean value indicating whether callbacks should be
35 disabled. When set to true, the TCL command specified by the -command
36 option is not executed when the -value of the ComboBox. changes.
37 [-disabledforeground disabledforeground] Specifies the foreground color
38 to be used when the ComboBox is disabled. [-dropdown dropdown] A Bool‐
39 ean value specifying the style of the ComboBox. When set to "true", the
40 listbox is only displayed temporarily when the arrow button is pressed.
41 When set to "false", the listbox is always displayed.
42 [-editable editable] Specifies whether the user is allowed to type into
43 the entry subwidget of the ComboBox. [-fancy fancy] A Boolean value
44 specifying whether the cross and tick button subwidgets should be
45 shown. [-grab grab] Specifies the pointer grabbing policy when the
46 listbox is popped up. Only values "global", "local" or "none" are
47 allowed. By default global grab is used. However, when you are develop‐
48 ing your application, you may want to use only local grabbing so that
49 in the event of errors, your X display won't be locked up.
50
51 Name: historyLimit
52 Class: historyLimit
53 Switch: -historylimit
54 Alias: -histlimit
55
56 Specifies how many previous user inputs can be stored in the
57 history list. [-history history] A Boolean value specifying
58 whether previous user inputs should be stored in the history
59 list. [-label label] Specifies the string to display as the
60 label of this ComboBox widget. [-labelside labelSide] Specifies
61 where the label should be displayed relative to the entry sub‐
62 widget. Valid options are: top, left, right, bottom, none or
63 acrosstop. [-listcmd listCmd] Specifies a TCL command to be
64 called every time when the listbox pops up. This option allows
65 you to fill up the listbox on-demand. This option is ignored
66 when the listbox is not in the dropdown style. [-list‐
67 width listWidth] If set, this option controls the width of the
68 listbox subwidget when it is popped up. The option is ignored
69 when the listbox is not in the dropdown style. [-prunehis‐
70 tory prunehistory] Specifies whether duplicated previous user
71 inputs should be pruned from the the history list. Only Boolean
72 values are allowed. [-selection selection] Contains the selec‐
73 tion in the ComboBox (the string displayed in the entry subwid‐
74 get). Depending on the -selectmode, the selection of a ComboBox
75 may be different than its -value. [-selection selection] This
76 option stores the temporary selection. When the user types in a
77 text string inside the entry widget, that string is considered
78 as a temporary input and is stored inside the -selection option.
79 The -value option is updated only when the user presses the
80 return key. [-selectmode selectMode] Specifies the how the com‐
81 bobox responds to the mouse button events in the listbox subwid‐
82 get; can eithet be "browse" or "immediate". The default -select‐
83 mode is "browse". See the BINDINGS section below.
84 [-state state] Specifies the whether the ComboBox is normal or
85 disabled. Only the values "normal" and "disabled" are recog‐
86 nized. [-tickbitmap tickBitmap] Specifies the bitmap to be used
87 in the "tick" button to the left of the entry widget. The
88 default is a bitmap in the file $tix_library/bitmaps/tick [-val‐
89 idatecmd validateCmd] Specifies a TCL command to be called when
90 the -value of the ComboBox is about to change. This command is
91 called with one parameter -- the new -value entered by the user.
92 This command is to validate this new value by returning a value
93 it deems valid. [-value value] Specifies the string to be dis‐
94 played in the entry subwidget of the ComboBox. When queried, the
95 returned value is the last value selected by the user. When the
96 -value option is changed as a result of the config -value widget
97 command, the TCL command specified by the -command option is
98 called. [-variable variable] Specifies the global variable in
99 which the value of the ComboBox should be stored. The value of
100 the ComboBox will be automatically updated when this variable is
101 changed.
102
104 Name: arrow
105 Class: Button
106
107 The down arrow button.
108
109 Name: cross
110 Class: Button
111
112 The cross button. Available only when -fancy is set.
113
114 Name: entry
115 Class: Entry
116
117 The entry that shows the value of this tixControl.
118
119 Name: label
120 Class: Label
121
122 The label subwidget.
123
124 Name: listbox
125 Class: Listbox
126
127 The listbox that holds all the list entries.
128
129 Name: slistbox
130 Class: TixScrolledListBox
131
132 The scrolled-listbox that provides the scrollbars.
133
134 Name: tick
135 Class: Button
136
137 The tick button. Available only when -fancy is set.
138
140 The tixComboBox command creates a new window (given by the pathName
141 argument) and makes it into a tixComboBox widget. Additional options,
142 described above, may be specified on the command line or in the option
143 database to configure aspects of the ComboBox such as its cursor and
144 relief.
145
146 The Tix ComboBox widget is similar to the combo box control in MS Win‐
147 dows. The user can select a choice by either typing in the entry subwd‐
148 get or selecting from the listbox subwidget.
149
151 The tixComboBox command creates a new Tcl command whose name is the
152 same as the path name of the ComboBox's window. This command may be
153 used to invoke various operations on the widget. It has the following
154 general form:
155 pathName option ?arg arg ...?
156 PathName is the name of the command, which is the same as the ComboBox
157 widget's path name. Option and the args determine the exact behavior of
158 the command. The following commands are possible for ComboBox widgets:
159
160 pathName addhistory string
161 Add the string to the beinning of the listbox.
162
163 pathName appendhistory string
164 Append the string to the end of the listbox.
165
166 pathName cget option
167 Returns the current value of the configuration option given by
168 option. Option may have any of the values accepted by the tix‐
169 ComboBox command.
170
171 pathName configure ?option? ?value option value ...?
172 Query or modify the configuration options of the widget. If no
173 option is specified, returns a list describing all of the avail‐
174 able options for pathName (see Tk_ConfigureInfo for information
175 on the format of this list). If option is specified with no
176 value, then the command returns a list describing the one named
177 option (this list will be identical to the corresponding sublist
178 of the value returned if no option is specified). If one or
179 more option-value pairs are specified, then the command modifies
180 the given widget option(s) to have the given value(s); in this
181 case the command returns an empty string. Option may have any
182 of the values accepted by the tixComboBox command.
183
184 pathName flash index string
185 Flashes the ComboBox. flash is usually called by a -command pro‐
186 cedure to acknowledge to the user that he has selected a value
187 for the ComboBox.
188
189 pathName insert index string
190 Insert the string into the listbox at the specified index.
191 index must be a valid listbox index.
192
193 pathName pick index
194 Set the (index)th item in the listbox to be the current value of
195 the ComboBox. As a result, the value of the ComboBox is changed
196 and the TCL command sepcified by the -command option will be
197 called.
198
199 pathName subwidget name ?args?
200 When no options are given, returns the pathname of the subwidget
201 of the specified name.
202
203 When options are given, the widget command of the specified sub‐
204 widget will be called with these options.
205
207 [1] If the -selectmode is "immediate", when the user enters a key‐
208 stroke, clicks on an item or drags the mouse pointer in the
209 listbox, the -value of the ComboBox will be immediately set to
210 this item and the -command procedure will be called.
211
212 [2] If the -selectmode is "browse", when the user enters a key‐
213 stroke, clicks on an item or drags the mouse pointer in the
214 listbox, the -selection of the ComboBox will be immediately set
215 to the new content of the entry subwidget; also the -browsecmd
216 procedure will be called. The -value option will be changed only
217 when the user invokes the ComboBox (see [3] below). If the user
218 presses the <Escape> key at any time, any new -selection will be
219 ignored and the text inside the entry subwidget will be restored
220 to the current -value of the ComboBox.
221
222 [3] If the -dropdown option is true, the user can invoke the Com‐
223 boBox by releasing the left mouse button over the desired item
224 in the listbox. If the -dropdown option is false, the user can
225 invoke the ComboBox by double-clicking over the desired item in
226 the listbox. In both cases, the user can also invoke the listbox
227 by pressing the <Return> or <Tab> key inside the entry subwid‐
228 get, or switching the input focus to another widget inside the
229 same toplevel widget
230
232 Starting from Tix vetsion 4.0, the default -value of the ComboBox is
233 the empty string. If you want the ComboBox to show a string by default,
234 you must configure its -value option explicitly.
235
237 Tix(n), ComboBox(n), listbox(n)
238
239
240
241
242
243Tix 4.0 tixComboBox(n)