OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tix/] [man/] [Select.html] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
 
2
 
3
 
4
<TITLE>tixSelect - Create and manipulate tixSelect widgets</TITLE>
5
<Center><H2>tixSelect - Create and manipulate tixSelect widgets</H2></Center><hr>
6
 
7
</pre><H3>SYNOPSIS</H3>
8
<B>tixSelect<I> <I>pathName ?<I>options</I></B>?
9
<P>
10
</pre><H3>SUPER-CLASS</H3>
11
The <B>TixSelect</B></I> class is derived from the <B>TixLabelWidget</B></I>
12
class and inherits all the commands, options and
13
subwidgets of its super-class.
14
</pre><H3>STANDARD OPTIONS</H3>
15
The Select widget supports all the standard options of a frame widget.
16
See the <B>options(n)</B></I> manual entry for details on the standard options.
17
</pre><H3>WIDGET-SPECIFIC OPTIONS</H3>
18
<P>
19
<pre><code><code><code>
20
Name:           <B>allowZero</B></I>
21
Class:          <B>AllowZero</B></I>
22
Switch:         <B>-allowzero</B></I>
23
</code></code></code></pre>
24
<UL>
25
A boolean value that specifies whether the selection can be empty.
26
When set to false, at least one button subwidget must be selected at
27
any time.
28
 
29
<B>Note</B></I>: When the Select widget is first constructed, the default
30
selection is always empty, even if <B>-allowzero</B></I> is set to
31
<B>false</B></I>.
32
</UL>
33
<P>
34
<pre><code><code><code>
35
Name:           <B>buttonType</B></I>
36
Class:          <B>ButtonType</B></I>
37
Switch:         <B>-buttontype</B></I>
38
</code></code></code></pre>
39
<UL>
40
The type of buttons to be used as subwidgets inside the Select widget.
41
By default, the standard Tk <B>button</B></I> widget class is used.
42
</UL>
43
<P>
44
<pre><code><code><code>
45
Name:           <B>command</B></I>
46
Class:          <B>Command</B></I>
47
Switch:         <B>-command</B></I>
48
</code></code></code></pre>
49
<UL>
50
Specifies the TCL command to be executed when the <B>-value</B></I> of the
51
Select widget is changed. This command will be invoked with
52
two arguments. The first is the name of the button subwidget that has
53
toggled. The second is a boolean value indicating whether the button
54
subwidget is selected. This command is executed only when the
55
<B>-disableCallback</B></I> option is set to false.
56
</UL>
57
<P>
58
<pre><code><code><code>
59
Name:           <B>disableCallback</B></I>
60
Class:          <B>DisableCallback</B></I>
61
Switch:         <B>-disablecallback</B></I>
62
</code></code></code></pre>
63
<UL>
64
A boolean value indicating whether callbacks should be disabled. When
65
set to true, the TCL command specified by the <B>-command</B></I> option
66
is not executed when the <B>-value</B></I> of the Select widget
67
changes.
68
</UL>
69
<P>
70
<pre><code><code><code>
71
Name:           <B>orientation</B></I>
72
Class:          <B>Orientation</B></I>
73
Switch:         <B>-orientation</B></I>
74
Alias:          <B>-orient</B></I>
75
</code></code></code></pre>
76
<UL>
77
Specifies the orientation of the button subwidgets. Only the values
78
<B>horizontal</B></I> and <B>vertical</B></I> are recognized. This is a
79
<I>static option</I></B> and it can only be assigned during the creation of
80
the widget.
81
</UL>
82
<P>
83
<pre><code><code><code>
84
Name:           <B>label</B></I>
85
Class:          <B>Label</B></I>
86
Switch:         <B>-label</B></I>
87
</code></code></code></pre>
88
<UL>
89
Specifies the string to display as the label of this Select widget.
90
</UL>
91
<P>
92
<pre><code><code><code>
93
Name:           <B>labelSide</B></I>
94
Class:          <B>LabelSide</B></I>
95
Switch:         <B>-labelside</B></I>
96
</code></code></code></pre>
97
<UL>
98
Specifies where the label should be displayed relative to the Select
99
widget. Valid options are: <B>top</B></I>, <B>left</B></I>, <B>right</B></I>,
100
<B>bottom</B></I>, <B>none</B></I> or <B>acrosstop</B></I>.
101
</UL>
102
<P>
103
<pre><code><code><code>
104
Name:           <B>padX</B></I>
105
Class:          <B>Pad</B></I>
106
Switch:         <B>-padx</B></I>
107
</code></code></code></pre>
108
<UL>
109
Specifies the horizontal padding between two neighboring button
110
subwidgets. This is a <I>static option</I></B> and it can only be assigned
111
during the creation of the widget.
112
</UL>
113
<P>
114
<pre><code><code><code>
115
Name:           <B>padY</B></I>
116
Class:          <B>Pad</B></I>
117
Switch:         <B>-padx</B></I>
118
</code></code></code></pre>
119
<UL>
120
Specifies the vertical padding between two neighboring button
121
subwidgets. This is a <I>static option</I></B> and it can only be assigned
122
during the creation of the widget.
123
</UL>
124
<P>
125
<pre><code><code><code>
126
Name:           <B>radio</B></I>
127
Class:          <B>Radio</B></I>
128
Switch:         <B>-radio</B></I>
129
</code></code></code></pre>
130
<UL>
131
A boolean value that specifies whether the Select widget
132
should act as a radio-box. When set to true, at most one button
133
subwidget can be selected at any time. This is a <I>static option</I></B>
134
and it can only be assigned during the creation of the widget.
135
</UL>
136
<P>
137
<pre><code><code><code>
138
Name:           <B>selectedBg</B></I>
139
Class:          <B>SelectedBg</B></I>
140
Switch:         <B>-selectedbg</B></I>
141
</code></code></code></pre>
142
<UL>
143
Specifies the background color of all the selected button subwidgets.
144
</UL>
145
<P>
146
<pre><code><code><code>
147
Name:           <B>state</B></I>
148
Class:          <B>State</B></I>
149
Switch:         <B>-state</B></I>
150
</code></code></code></pre>
151
<UL>
152
Specifies the state of all the buttons inside the Select widget.  Only
153
the values <B>normal</B></I> and <B>disabled</B></I> are recognized. When the
154
state is set to <B>disabled</B></I>, all user actions on this Select widget
155
are ignore.
156
</UL>
157
<P>
158
<pre><code><code><code>
159
Name:           <B>validateCmd</B></I>
160
Class:          <B>ValidateCmd</B></I>
161
Switch:         <B>-validatecmd</B></I>
162
</code></code></code></pre>
163
<UL>
164
Specifies a TCL command to be called when the -value of the
165
Select widget is about to change. This command is called with
166
one parameter -- the new <B>-value</B></I> entered by the user. This
167
command is to validate this new value by returning a value it deems
168
valid.
169
</UL>
170
<P>
171
<pre><code><code><code>
172
Name:           <B>value</B></I>
173
Class:          <B>Value</B></I>
174
Switch:         <B>-value</B></I>
175
</code></code></code></pre>
176
<UL>
177
The value of a Select widget is a list of the names of the
178
button subwidgets that have been selected by the user.
179
 
180
When you assign the value of a Select widget using the "config -value"
181
widget command, the TCL command specified by the <B>-command</B></I>
182
option will be invoked if some button subwidgets are toggled.
183
</UL>
184
<P>
185
<pre><code><code><code>
186
Name:           <B>variable</B></I>
187
Class:          <B>Variable</B></I>
188
Switch:         <B>-variable</B></I>
189
</code></code></code></pre>
190
<UL>
191
Specifies the global variable in which the value of the Select widget
192
should be stored. The value of a Select widget is stored as a list of
193
the names of the button subwidgets that have been selected by the
194
user. The value of the Select widget will be automatically updated
195
when this variable is changed.
196
</UL>
197
</pre><H3>SUBWIDGETS</H3>
198
<P>
199
<P>
200
<pre><code><code><code>
201
Name:           <B>label</B></I>
202
Class:          <B>Label</B></I>
203
</code></code></code></pre>
204
<UL>
205
The label subwidget.
206
</UL>
207
<P>
208
In addition, all the button subwidgets created as a result of the
209
<B>add</B></I> widget command can be accessed by the <B>subwidget</B></I>
210
command. They are identified by the <I>buttonName</I></B> parameter to the
211
<B>add</B></I> widget command. Here is an example:
212
<P>
213
<pre><code><code><code>
214
        tixSelect .s
215
        pack .s
216
        .s add eat   -text Eat
217
        .s add sleep -text Sleep
218
        .s subwidget eat   config -fg green
219
        .s subwidget sleep config -fg red
220
</code></code></code></pre>
221
</pre><HR>
222
</pre><H3>DESCRIPTION</H3>
223
<P>
224
The <B>tixSelect</B></I> command creates a new window (given by the
225
<I>pathName</I></B> argument) and makes it into a Select widget.
226
Additional options, described above, may be specified on the command
227
line or in the option database to configure aspects of the
228
Select widget such as its cursor and relief.
229
 
230
The Select widget is a container of button subwidgets. It can
231
be used to provide radio-box or check-box style of selection options
232
for the user.
233
</pre><H3>WIDGET COMMANDS</H3>
234
<P>
235
The <B>tixSelect</B></I> command creates a new Tcl command whose name is
236
command may be used to invoke various operations on the widget.  It
237
has the following general form:
238
<pre>
239
<I>pathName option </I></B>?<I>arg arg ...</I></B>?
240
<P>
241
</pre>
242
<I>PathName</I></B> is the name of the command, which is the same as the
243
determine the exact behavior of the command.  The following commands
244
are possible for Select widgets:
245
<DL>
246
<DT> <I>pathName <B>add<I> buttonName </I></B>?<I>option value ... </I></B>?
247
</I></B>
248
<DD> Adds a new button subwidget with the name </B></I>buttonName</B></I> into the
249
Select widget. Additional configuration options can be given
250
to configure the new button subwidget.
251
</DL>
252
<DL>
253
<DT> <I>pathName <B>cget<I> <I>option</I></B>
254
</I></B>
255
<DD> Returns the current value of the configuration option given by
256
<I>option</I></B>. <I>Option</I></B> may have any of the values accepted by the
257
<B>tixSelect</B></I> command.
258
</DL>
259
<DL>
260
<DT> <I>pathName <B>configure</B></I> ?<I>option</I></B>? <I>?value option value ...</I></B>?
261
</I></B>
262
<DD> Query or modify the configuration options of the widget.  If no
263
<I>option</I></B> is specified, returns a list describing all of the
264
available options for <I>pathName</I></B> (see <B>Tk_ConfigureInfo</B></I> for
265
information on the format of this list). If <I>option</I></B> is specified
266
with no <I>value</I></B>, then the command returns a list describing the
267
one named option (this list will be identical to the corresponding
268
sublist of the value returned if no <I>option</I></B> is specified).  If
269
one or more <I>option-value</I></B> pairs are specified, then the command
270
modifies the given widget option(s) to have the given value(s); in
271
this case the command returns an empty string.  <I>Option</I></B> may have
272
any of the values accepted by the <B>tixSelect</B></I> command.
273
</DL>
274
<DL>
275
<DT> <I>pathName <B>invoke<I> buttonName</I></B>
276
</I></B>
277
<DD> Invokes the button subwidget with the name </B></I>buttonName</B></I>.
278
</DL>
279
<DL>
280
<DT> <I>pathName <B>subwidget<I> name ?args?</I></B>
281
</I></B>
282
<DD> When no options are given, returns the pathname of the subwidget of
283
the specified name.
284
 
285
When options are given, the widget command of the specified subwidget will
286
be called with these options.
287
</DL>
288
</pre><H3>BINDINGS</H3>
289
<P>
290
When the user presses the left mouse button over the a button
291
subwidget, it will be toggled and the <B>-value</B></I> option of the
292
tixSelect widget will be changed.
293
</pre><H3>EXAMPLE</H3>
294
<P>
295
The following example creates a radio-box style iconbar for the user
296
to choose one value among <B>eat</B></I>, <B>work</B></I> or <B>sleep</B></I>.
297
<P>
298
<pre><code><code><code>
299
        tixSelect .s -radio true -allowzero false
300
        .s add eat   -bitmap [tix getbitmap eat]
301
        .s add work  -bitmap [tix getbitmap work]
302
        .s add sleep -bitmap [tix getbitmap sleep]
303
</code></code></code></pre>
304
</pre><H3>KEYWORDS</H3>
305
Tix(n), Container Widget
306
<hr><i>Last modified Sun Jan 19 22:34:38 EST 1997 </i> ---
307
<i>Serial 853731305</i>

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.