1 |
578 |
markom |
'\"
|
2 |
|
|
'\" Copyright (c) 1996, Expert Interface Technologies
|
3 |
|
|
'\"
|
4 |
|
|
'\" See the file "license.terms" for information on usage and redistribution
|
5 |
|
|
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
6 |
|
|
'\"
|
7 |
|
|
'\" The file man.macros and some of the macros used by this file are
|
8 |
|
|
'\" copyrighted: (c) 1990 The Regents of the University of California.
|
9 |
|
|
'\" (c) 1994-1995 Sun Microsystems, Inc.
|
10 |
|
|
'\" The license terms of the Tcl/Tk distrobution are in the file
|
11 |
|
|
'\" license.tcl.
|
12 |
|
|
.so man.macros
|
13 |
|
|
'----------------------------------------------------------------------
|
14 |
|
|
.HS tixSelect tix 4.0
|
15 |
|
|
.BS
|
16 |
|
|
'
|
17 |
|
|
'
|
18 |
|
|
'----------------------------------------------------------------------
|
19 |
|
|
.SH NAME
|
20 |
|
|
tixSelect \- Create and manipulate tixSelect widgets
|
21 |
|
|
'
|
22 |
|
|
'
|
23 |
|
|
'
|
24 |
|
|
'----------------------------------------------------------------------
|
25 |
|
|
.SH SYNOPSIS
|
26 |
|
|
\fBtixSelect\fI \fIpathName ?\fIoptions\fR?
|
27 |
|
|
'
|
28 |
|
|
'
|
29 |
|
|
'
|
30 |
|
|
'----------------------------------------------------------------------
|
31 |
|
|
.PP
|
32 |
|
|
.SH SUPER-CLASS
|
33 |
|
|
The \fBTixSelect\fR class is derived from the \fBTixLabelWidget\fR
|
34 |
|
|
class and inherits all the commands, options and
|
35 |
|
|
subwidgets of its super-class.
|
36 |
|
|
'
|
37 |
|
|
'----------------------------------------------------------------------
|
38 |
|
|
.SH "STANDARD OPTIONS"
|
39 |
|
|
'
|
40 |
|
|
The Select widget supports all the standard options of a frame widget.
|
41 |
|
|
See the \fBoptions(n)\fR manual entry for details on the standard options.
|
42 |
|
|
'
|
43 |
|
|
'
|
44 |
|
|
'----------------------------------------------------------------------
|
45 |
|
|
.SH "WIDGET-SPECIFIC OPTIONS"
|
46 |
|
|
'
|
47 |
|
|
'----------BEGIN
|
48 |
|
|
.LP
|
49 |
|
|
.nf
|
50 |
|
|
Name: \fBallowZero\fR
|
51 |
|
|
Class: \fBAllowZero\fR
|
52 |
|
|
Switch: \fB\-allowzero\fR
|
53 |
|
|
.fi
|
54 |
|
|
.IP
|
55 |
|
|
A boolean value that specifies whether the selection can be empty.
|
56 |
|
|
When set to false, at least one button subwidget must be selected at
|
57 |
|
|
any time.
|
58 |
|
|
|
59 |
|
|
\fBNote\fR: When the Select widget is first constructed, the default
|
60 |
|
|
selection is always empty, even if \fB\-allowzero\fR is set to
|
61 |
|
|
\fBfalse\fR.
|
62 |
|
|
'----------END
|
63 |
|
|
'
|
64 |
|
|
'----------BEGIN
|
65 |
|
|
.LP
|
66 |
|
|
.nf
|
67 |
|
|
Name: \fBbuttonType\fR
|
68 |
|
|
Class: \fBButtonType\fR
|
69 |
|
|
Switch: \fB\-buttontype\fR
|
70 |
|
|
.fi
|
71 |
|
|
.IP
|
72 |
|
|
The type of buttons to be used as subwidgets inside the Select widget.
|
73 |
|
|
By default, the standard Tk \fBbutton\fR widget class is used.
|
74 |
|
|
'----------END
|
75 |
|
|
'
|
76 |
|
|
'
|
77 |
|
|
'----------BEGIN
|
78 |
|
|
.LP
|
79 |
|
|
.nf
|
80 |
|
|
Name: \fBcommand\fR
|
81 |
|
|
Class: \fBCommand\fR
|
82 |
|
|
Switch: \fB\-command\fR
|
83 |
|
|
.fi
|
84 |
|
|
.IP
|
85 |
|
|
Specifies the TCL command to be executed when the \fB\-value\fR of the
|
86 |
|
|
Select widget is changed. This command will be invoked with
|
87 |
|
|
two arguments. The first is the name of the button subwidget that has
|
88 |
|
|
toggled. The second is a boolean value indicating whether the button
|
89 |
|
|
subwidget is selected. This command is executed only when the
|
90 |
|
|
\fB\-disableCallback\fR option is set to false.
|
91 |
|
|
'----------END
|
92 |
|
|
'
|
93 |
|
|
'----------BEGIN
|
94 |
|
|
.LP
|
95 |
|
|
.nf
|
96 |
|
|
Name: \fBdisableCallback\fR
|
97 |
|
|
Class: \fBDisableCallback\fR
|
98 |
|
|
Switch: \fB\-disablecallback\fR
|
99 |
|
|
.fi
|
100 |
|
|
.IP
|
101 |
|
|
A boolean value indicating whether callbacks should be disabled. When
|
102 |
|
|
set to true, the TCL command specified by the \fB\-command\fR option
|
103 |
|
|
is not executed when the \fB\-value\fR of the Select widget
|
104 |
|
|
changes.
|
105 |
|
|
'----------END
|
106 |
|
|
'
|
107 |
|
|
'----------BEGIN
|
108 |
|
|
.LP
|
109 |
|
|
.nf
|
110 |
|
|
Name: \fBorientation\fR
|
111 |
|
|
Class: \fBOrientation\fR
|
112 |
|
|
Switch: \fB\-orientation\fR
|
113 |
|
|
Alias: \fB\-orient\fR
|
114 |
|
|
.fi
|
115 |
|
|
.IP
|
116 |
|
|
Specifies the orientation of the button subwidgets. Only the values
|
117 |
|
|
\fBhorizontal\fR and \fBvertical\fR are recognized. This is a
|
118 |
|
|
\fIstatic option\fR and it can only be assigned during the creation of
|
119 |
|
|
the widget.
|
120 |
|
|
'----------END
|
121 |
|
|
'
|
122 |
|
|
'----------BEGIN
|
123 |
|
|
.LP
|
124 |
|
|
.nf
|
125 |
|
|
Name: \fBlabel\fR
|
126 |
|
|
Class: \fBLabel\fR
|
127 |
|
|
Switch: \fB\-label\fR
|
128 |
|
|
.fi
|
129 |
|
|
.IP
|
130 |
|
|
Specifies the string to display as the label of this Select widget.
|
131 |
|
|
'----------END
|
132 |
|
|
'
|
133 |
|
|
'----------BEGIN
|
134 |
|
|
.LP
|
135 |
|
|
.nf
|
136 |
|
|
Name: \fBlabelSide\fR
|
137 |
|
|
Class: \fBLabelSide\fR
|
138 |
|
|
Switch: \fB\-labelside\fR
|
139 |
|
|
.fi
|
140 |
|
|
.IP
|
141 |
|
|
Specifies where the label should be displayed relative to the Select
|
142 |
|
|
widget. Valid options are: \fBtop\fR, \fBleft\fR, \fBright\fR,
|
143 |
|
|
\fBbottom\fR, \fBnone\fR or \fBacrosstop\fR.
|
144 |
|
|
'----------END
|
145 |
|
|
'
|
146 |
|
|
'----------BEGIN
|
147 |
|
|
.LP
|
148 |
|
|
.nf
|
149 |
|
|
Name: \fBpadX\fR
|
150 |
|
|
Class: \fBPad\fR
|
151 |
|
|
Switch: \fB\-padx\fR
|
152 |
|
|
.fi
|
153 |
|
|
.IP
|
154 |
|
|
Specifies the horizontal padding between two neighboring button
|
155 |
|
|
subwidgets. This is a \fIstatic option\fR and it can only be assigned
|
156 |
|
|
during the creation of the widget.
|
157 |
|
|
'----------END
|
158 |
|
|
'
|
159 |
|
|
'----------BEGIN
|
160 |
|
|
.LP
|
161 |
|
|
.nf
|
162 |
|
|
Name: \fBpadY\fR
|
163 |
|
|
Class: \fBPad\fR
|
164 |
|
|
Switch: \fB\-padx\fR
|
165 |
|
|
.fi
|
166 |
|
|
.IP
|
167 |
|
|
Specifies the vertical padding between two neighboring button
|
168 |
|
|
subwidgets. This is a \fIstatic option\fR and it can only be assigned
|
169 |
|
|
during the creation of the widget.
|
170 |
|
|
'----------END
|
171 |
|
|
'
|
172 |
|
|
'----------BEGIN
|
173 |
|
|
.LP
|
174 |
|
|
.nf
|
175 |
|
|
Name: \fBradio\fR
|
176 |
|
|
Class: \fBRadio\fR
|
177 |
|
|
Switch: \fB\-radio\fR
|
178 |
|
|
.fi
|
179 |
|
|
.IP
|
180 |
|
|
A boolean value that specifies whether the Select widget
|
181 |
|
|
should act as a radio-box. When set to true, at most one button
|
182 |
|
|
subwidget can be selected at any time. This is a \fIstatic option\fR
|
183 |
|
|
and it can only be assigned during the creation of the widget.
|
184 |
|
|
'----------END
|
185 |
|
|
'
|
186 |
|
|
'
|
187 |
|
|
'----------BEGIN
|
188 |
|
|
.LP
|
189 |
|
|
.nf
|
190 |
|
|
Name: \fBselectedBg\fR
|
191 |
|
|
Class: \fBSelectedBg\fR
|
192 |
|
|
Switch: \fB\-selectedbg\fR
|
193 |
|
|
.fi
|
194 |
|
|
.IP
|
195 |
|
|
Specifies the background color of all the selected button subwidgets.
|
196 |
|
|
'----------END
|
197 |
|
|
'
|
198 |
|
|
'----------BEGIN
|
199 |
|
|
.LP
|
200 |
|
|
.nf
|
201 |
|
|
Name: \fBstate\fR
|
202 |
|
|
Class: \fBState\fR
|
203 |
|
|
Switch: \fB\-state\fR
|
204 |
|
|
.fi
|
205 |
|
|
.IP
|
206 |
|
|
Specifies the state of all the buttons inside the Select widget. Only
|
207 |
|
|
the values \fBnormal\fR and \fBdisabled\fR are recognized. When the
|
208 |
|
|
state is set to \fBdisabled\fR, all user actions on this Select widget
|
209 |
|
|
are ignore.
|
210 |
|
|
'----------END
|
211 |
|
|
'
|
212 |
|
|
'
|
213 |
|
|
'----------BEGIN
|
214 |
|
|
.LP
|
215 |
|
|
.nf
|
216 |
|
|
Name: \fBvalidateCmd\fR
|
217 |
|
|
Class: \fBValidateCmd\fR
|
218 |
|
|
Switch: \fB\-validatecmd\fR
|
219 |
|
|
.fi
|
220 |
|
|
.IP
|
221 |
|
|
Specifies a TCL command to be called when the -value of the
|
222 |
|
|
Select widget is about to change. This command is called with
|
223 |
|
|
one parameter -- the new \fB\-value\fR entered by the user. This
|
224 |
|
|
command is to validate this new value by returning a value it deems
|
225 |
|
|
valid.
|
226 |
|
|
'----------END
|
227 |
|
|
'
|
228 |
|
|
'----------BEGIN
|
229 |
|
|
.LP
|
230 |
|
|
.nf
|
231 |
|
|
Name: \fBvalue\fR
|
232 |
|
|
Class: \fBValue\fR
|
233 |
|
|
Switch: \fB\-value\fR
|
234 |
|
|
.fi
|
235 |
|
|
.IP
|
236 |
|
|
The value of a Select widget is a list of the names of the
|
237 |
|
|
button subwidgets that have been selected by the user.
|
238 |
|
|
|
239 |
|
|
When you assign the value of a Select widget using the "config -value"
|
240 |
|
|
widget command, the TCL command specified by the \fB\-command\fR
|
241 |
|
|
option will be invoked if some button subwidgets are toggled.
|
242 |
|
|
'----------END
|
243 |
|
|
'
|
244 |
|
|
'
|
245 |
|
|
'----------BEGIN
|
246 |
|
|
.LP
|
247 |
|
|
.nf
|
248 |
|
|
Name: \fBvariable\fR
|
249 |
|
|
Class: \fBVariable\fR
|
250 |
|
|
Switch: \fB\-variable\fR
|
251 |
|
|
.fi
|
252 |
|
|
.IP
|
253 |
|
|
Specifies the global variable in which the value of the Select widget
|
254 |
|
|
should be stored. The value of a Select widget is stored as a list of
|
255 |
|
|
the names of the button subwidgets that have been selected by the
|
256 |
|
|
user. The value of the Select widget will be automatically updated
|
257 |
|
|
when this variable is changed.
|
258 |
|
|
'----------END
|
259 |
|
|
'
|
260 |
|
|
'----------------------------------------------------------------------
|
261 |
|
|
.SH SUBWIDGETS
|
262 |
|
|
.PP
|
263 |
|
|
'
|
264 |
|
|
'
|
265 |
|
|
'----------BEGIN
|
266 |
|
|
.LP
|
267 |
|
|
.nf
|
268 |
|
|
Name: \fBlabel\fR
|
269 |
|
|
Class: \fBLabel\fR
|
270 |
|
|
.fi
|
271 |
|
|
.IP
|
272 |
|
|
The label subwidget.
|
273 |
|
|
'----------END
|
274 |
|
|
.PP
|
275 |
|
|
In addition, all the button subwidgets created as a result of the
|
276 |
|
|
\fBadd\fR widget command can be accessed by the \fBsubwidget\fR
|
277 |
|
|
command. They are identified by the \fIbuttonName\fR parameter to the
|
278 |
|
|
\fBadd\fR widget command. Here is an example:
|
279 |
|
|
.PP
|
280 |
|
|
.nf
|
281 |
|
|
tixSelect .s
|
282 |
|
|
pack .s
|
283 |
|
|
.s add eat -text Eat
|
284 |
|
|
.s add sleep -text Sleep
|
285 |
|
|
.s subwidget eat config -fg green
|
286 |
|
|
.s subwidget sleep config -fg red
|
287 |
|
|
.fi
|
288 |
|
|
'
|
289 |
|
|
'
|
290 |
|
|
.BE
|
291 |
|
|
'
|
292 |
|
|
'----------------------------------------------------------------------
|
293 |
|
|
.SH DESCRIPTION
|
294 |
|
|
'
|
295 |
|
|
.PP
|
296 |
|
|
'
|
297 |
|
|
The \fBtixSelect\fR command creates a new window (given by the
|
298 |
|
|
\fIpathName\fR argument) and makes it into a Select widget.
|
299 |
|
|
Additional options, described above, may be specified on the command
|
300 |
|
|
line or in the option database to configure aspects of the
|
301 |
|
|
Select widget such as its cursor and relief.
|
302 |
|
|
|
303 |
|
|
The Select widget is a container of button subwidgets. It can
|
304 |
|
|
be used to provide radio-box or check-box style of selection options
|
305 |
|
|
for the user.
|
306 |
|
|
'
|
307 |
|
|
'----------------------------------------------------------------------
|
308 |
|
|
.SH WIDGET COMMANDS
|
309 |
|
|
.PP
|
310 |
|
|
'
|
311 |
|
|
The \fBtixSelect\fR command creates a new Tcl command whose name is
|
312 |
|
|
the same as the path name of the Select widget's window. This
|
313 |
|
|
command may be used to invoke various operations on the widget. It
|
314 |
|
|
has the following general form:
|
315 |
|
|
'
|
316 |
|
|
.DS C
|
317 |
|
|
'
|
318 |
|
|
\fIpathName option \fR?\fIarg arg ...\fR?
|
319 |
|
|
.PP
|
320 |
|
|
.DE
|
321 |
|
|
'
|
322 |
|
|
\fIPathName\fR is the name of the command, which is the same as the
|
323 |
|
|
Select widget's path name. \fIOption\fR and the \fIarg\fRs
|
324 |
|
|
determine the exact behavior of the command. The following commands
|
325 |
|
|
are possible for Select widgets:
|
326 |
|
|
'
|
327 |
|
|
.TP
|
328 |
|
|
\fIpathName \fBadd\fI buttonName \fR?\fIoption value ... \fR?
|
329 |
|
|
'
|
330 |
|
|
Adds a new button subwidget with the name \fRbuttonName\fR into the
|
331 |
|
|
Select widget. Additional configuration options can be given
|
332 |
|
|
to configure the new button subwidget.
|
333 |
|
|
'
|
334 |
|
|
.TP
|
335 |
|
|
\fIpathName \fBcget\fI \fIoption\fR
|
336 |
|
|
'
|
337 |
|
|
Returns the current value of the configuration option given by
|
338 |
|
|
\fIoption\fR. \fIOption\fR may have any of the values accepted by the
|
339 |
|
|
\fBtixSelect\fR command.
|
340 |
|
|
'
|
341 |
|
|
.TP
|
342 |
|
|
'
|
343 |
|
|
\fIpathName \fBconfigure\fR ?\fIoption\fR? \fI?value option value ...\fR?
|
344 |
|
|
'
|
345 |
|
|
Query or modify the configuration options of the widget. If no
|
346 |
|
|
\fIoption\fR is specified, returns a list describing all of the
|
347 |
|
|
available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
|
348 |
|
|
information on the format of this list). If \fIoption\fR is specified
|
349 |
|
|
with no \fIvalue\fR, then the command returns a list describing the
|
350 |
|
|
one named option (this list will be identical to the corresponding
|
351 |
|
|
sublist of the value returned if no \fIoption\fR is specified). If
|
352 |
|
|
one or more \fIoption\-value\fR pairs are specified, then the command
|
353 |
|
|
modifies the given widget option(s) to have the given value(s); in
|
354 |
|
|
this case the command returns an empty string. \fIOption\fR may have
|
355 |
|
|
any of the values accepted by the \fBtixSelect\fR command.
|
356 |
|
|
'
|
357 |
|
|
'
|
358 |
|
|
.TP
|
359 |
|
|
\fIpathName \fBinvoke\fI buttonName\fR
|
360 |
|
|
'
|
361 |
|
|
Invokes the button subwidget with the name \fRbuttonName\fR.
|
362 |
|
|
'
|
363 |
|
|
'
|
364 |
|
|
.TP
|
365 |
|
|
\fIpathName \fBsubwidget\fI name ?args?\fR
|
366 |
|
|
'
|
367 |
|
|
When no options are given, returns the pathname of the subwidget of
|
368 |
|
|
the specified name.
|
369 |
|
|
|
370 |
|
|
When options are given, the widget command of the specified subwidget will
|
371 |
|
|
be called with these options.
|
372 |
|
|
'
|
373 |
|
|
'
|
374 |
|
|
'----------------------------------------------------------------------
|
375 |
|
|
.SH BINDINGS
|
376 |
|
|
.PP
|
377 |
|
|
'
|
378 |
|
|
When the user presses the left mouse button over the a button
|
379 |
|
|
subwidget, it will be toggled and the \fB\-value\fR option of the
|
380 |
|
|
tixSelect widget will be changed.
|
381 |
|
|
'
|
382 |
|
|
'----------------------------------------------------------------------
|
383 |
|
|
.SH EXAMPLE
|
384 |
|
|
.PP
|
385 |
|
|
'
|
386 |
|
|
The following example creates a radio-box style iconbar for the user
|
387 |
|
|
to choose one value among \fBeat\fR, \fBwork\fR or \fBsleep\fR.
|
388 |
|
|
.PP
|
389 |
|
|
.nf
|
390 |
|
|
tixSelect .s \-radio true \-allowzero false
|
391 |
|
|
.s add eat \-bitmap [tix getbitmap eat]
|
392 |
|
|
.s add work \-bitmap [tix getbitmap work]
|
393 |
|
|
.s add sleep \-bitmap [tix getbitmap sleep]
|
394 |
|
|
.fi
|
395 |
|
|
'
|
396 |
|
|
'
|
397 |
|
|
'
|
398 |
|
|
'----------------------------------------------------------------------
|
399 |
|
|
.SH KEYWORDS
|
400 |
|
|
Tix(n), Container Widget
|