1 |
578 |
markom |
<HTML>
|
2 |
|
|
<HEAD>
|
3 |
|
|
<TITLE>iwidgets2.2.0 User Commands - buttonbox</TITLE>
|
4 |
|
|
</HEAD>
|
5 |
|
|
<BODY BGCOLOR="#FFFFFF">
|
6 |
|
|
<H1>iwidgets2.2.0 User Commands - buttonbox</H1>
|
7 |
|
|
<HR>
|
8 |
|
|
<PRE>
|
9 |
|
|
|
10 |
|
|
</PRE>
|
11 |
|
|
<H2><HR ALIGN=LEFT WIDTH=70% SIZE=3></H2><PRE>
|
12 |
|
|
|
13 |
|
|
|
14 |
|
|
</PRE>
|
15 |
|
|
<H2>NAME</H2><PRE>
|
16 |
|
|
buttonbox - Create and manipulate a manager widget for but-
|
17 |
|
|
tons
|
18 |
|
|
|
19 |
|
|
|
20 |
|
|
</PRE>
|
21 |
|
|
<H2>SYNOPSIS</H2><PRE>
|
22 |
|
|
<STRONG>buttonbox</STRONG> <EM>pathName</EM> ?<EM>options</EM>?
|
23 |
|
|
|
24 |
|
|
|
25 |
|
|
</PRE>
|
26 |
|
|
<H2>INHERITANCE</H2><PRE>
|
27 |
|
|
itk::Widget <- buttonbox
|
28 |
|
|
|
29 |
|
|
|
30 |
|
|
</PRE>
|
31 |
|
|
<H2>STANDARD OPTIONS</H2><PRE>
|
32 |
|
|
<STRONG>background</STRONG> <STRONG>cursor</STRONG>
|
33 |
|
|
|
34 |
|
|
See the "options" manual entry for details on the standard
|
35 |
|
|
options.
|
36 |
|
|
|
37 |
|
|
|
38 |
|
|
</PRE>
|
39 |
|
|
<H2>WIDGET-SPECIFIC OPTIONS</H2><PRE>
|
40 |
|
|
Name: <STRONG>orient</STRONG>
|
41 |
|
|
Class: <STRONG>Orient</STRONG>
|
42 |
|
|
Command-Line Switch: <STRONG>-orient</STRONG>
|
43 |
|
|
|
44 |
|
|
Orientation of the button box: <STRONG>horizontal</STRONG> or <STRONG>vertical</STRONG>.
|
45 |
|
|
The default is horizontal.
|
46 |
|
|
|
47 |
|
|
Name: <STRONG>padX</STRONG>
|
48 |
|
|
Class: <STRONG>PadX</STRONG>
|
49 |
|
|
Command-Line Switch: <STRONG>-padx</STRONG>
|
50 |
|
|
|
51 |
|
|
Specifies a non-negative padding distance to leave
|
52 |
|
|
between the button group and the outer edge of the but-
|
53 |
|
|
ton box in the x direction. The value may be given in
|
54 |
|
|
any of the forms acceptable to <STRONG>Tk_GetPixels</STRONG>. The
|
55 |
|
|
default is 5 pixels.
|
56 |
|
|
|
57 |
|
|
Name: <STRONG>padY</STRONG>
|
58 |
|
|
Class: <STRONG>PadY</STRONG>
|
59 |
|
|
Command-Line Switch: <STRONG>-pady</STRONG>
|
60 |
|
|
|
61 |
|
|
Specifies a non-negative padding distance to leave
|
62 |
|
|
between the button group and the outer edge of the but-
|
63 |
|
|
ton box in the y direction. The value may be given in
|
64 |
|
|
any of the forms acceptable to <STRONG>Tk_GetPixels</STRONG>. The
|
65 |
|
|
default is 5 pixels.
|
66 |
|
|
|
67 |
|
|
|
68 |
|
|
</PRE>
|
69 |
|
|
<H2><HR ALIGN=LEFT WIDTH=70% SIZE=3></H2><PRE>
|
70 |
|
|
|
71 |
|
|
|
72 |
|
|
|
73 |
|
|
</PRE>
|
74 |
|
|
<H2>DESCRIPTION</H2><PRE>
|
75 |
|
|
The <STRONG>buttonbox</STRONG> command creates a manager widget for control-
|
76 |
|
|
ling buttons. The button box also supports the display and
|
77 |
|
|
invocation of a default button. The button box can be con-
|
78 |
|
|
figured either horizontally or vertically.
|
79 |
|
|
|
80 |
|
|
|
81 |
|
|
|
82 |
|
|
</PRE>
|
83 |
|
|
<H2>METHODS</H2><PRE>
|
84 |
|
|
The <STRONG>buttonbox</STRONG> command creates a new Tcl command whose name
|
85 |
|
|
is <EM>pathName</EM>. This command may be used to invoke various
|
86 |
|
|
operations on the widget. It has the following general
|
87 |
|
|
form:
|
88 |
|
|
|
89 |
|
|
<EM>pathName</EM> <EM>option</EM> ?<EM>arg</EM> <EM>arg</EM> ...?
|
90 |
|
|
|
91 |
|
|
<EM>Option</EM> and the <EM>arg</EM>s determine the exact behavior of the com-
|
92 |
|
|
mand.
|
93 |
|
|
|
94 |
|
|
Many of the widget commands for the buttonbox take as one
|
95 |
|
|
argument an indicator of which button of the button box to
|
96 |
|
|
operate on. These indicators are called <EM>indexes</EM> and allow
|
97 |
|
|
reference and manipulation of buttons regardless of their
|
98 |
|
|
current map state. buttonbox indexes may be specified in
|
99 |
|
|
any of the following forms:
|
100 |
|
|
|
101 |
|
|
<EM>number</EM> Specifies the button numerically, where 0
|
102 |
|
|
corresponds to the left/top-most button of the
|
103 |
|
|
button box.
|
104 |
|
|
|
105 |
|
|
<STRONG>end</STRONG> Indicates the right/bottom-most button of the
|
106 |
|
|
button box.
|
107 |
|
|
|
108 |
|
|
<STRONG>default</STRONG> Indicates the current default button of the but-
|
109 |
|
|
ton box. This is the button with the default
|
110 |
|
|
ring displayed.
|
111 |
|
|
|
112 |
|
|
<EM>pattern</EM> If the index doesn't satisfy one of the above
|
113 |
|
|
forms then this form is used. <EM>Pattern</EM> is
|
114 |
|
|
pattern-matched against the tag of each button
|
115 |
|
|
in the button box, in order from left/top to
|
116 |
|
|
right/left, until a matching entry is found.
|
117 |
|
|
The rules of <STRONG>Tcl_StringMatch</STRONG> are used.
|
118 |
|
|
|
119 |
|
|
|
120 |
|
|
|
121 |
|
|
</PRE>
|
122 |
|
|
<H2>WIDGET-SPECIFIC METHODS</H2><PRE>
|
123 |
|
|
<EM>pathName</EM> <STRONG>add</STRONG> <EM>tag</EM> <EM>args</EM>
|
124 |
|
|
Add a button distinguished by <EM>tag</EM> to the end of the
|
125 |
|
|
button box. If additional arguments are present they
|
126 |
|
|
specify options to be applied to the button. See <STRONG>Push-</STRONG>
|
127 |
|
|
<STRONG>Button</STRONG> for information on the options available.
|
128 |
|
|
|
129 |
|
|
<EM>pathName</EM> <STRONG>buttonconfigure</STRONG> <EM>index</EM> ?<EM>options</EM>?
|
130 |
|
|
This command is similar to the <STRONG>configure</STRONG> command,
|
131 |
|
|
except that it applies to the options for an individual
|
132 |
|
|
button, whereas <STRONG>configure</STRONG> applies to the options for
|
133 |
|
|
the button box as a whole. <EM>Options</EM> may have any of the
|
134 |
|
|
values accepted by the <STRONG>PushButton</STRONG> command. If <EM>options</EM>
|
135 |
|
|
are specified, options are modified as indicated in the
|
136 |
|
|
command and the command returns an empty string. If no
|
137 |
|
|
<EM>options</EM> are specified, returns a list describing the
|
138 |
|
|
current options for entry <EM>index</EM> (see <STRONG>Tk_ConfigureInfo</STRONG>
|
139 |
|
|
for information on the format of this list).
|
140 |
|
|
|
141 |
|
|
<EM>pathName</EM> <STRONG>cget</STRONG> <EM>option</EM>
|
142 |
|
|
Returns the current value of the configuration option
|
143 |
|
|
given by <EM>option</EM>. <EM>Option</EM> may have any of the values
|
144 |
|
|
accepted by the <STRONG>buttonbox</STRONG> command.
|
145 |
|
|
|
146 |
|
|
<EM>pathName</EM> <STRONG>configure</STRONG> ?<EM>option</EM>? ?<EM>value</EM> <EM>option</EM> <EM>value</EM> ...?
|
147 |
|
|
Query or modify the configuration options of the
|
148 |
|
|
widget. If no <EM>option</EM> is specified, returns a list
|
149 |
|
|
describing all of the available options for <EM>pathName</EM>
|
150 |
|
|
(see <STRONG>Tk_ConfigureInfo</STRONG> for information on the format of
|
151 |
|
|
this list). If <EM>option</EM> is specified with no <EM>value</EM>, then
|
152 |
|
|
the command returns a list describing the one named
|
153 |
|
|
option (this list will be identical to the correspond-
|
154 |
|
|
ing sublist of the value returned if no <EM>option</EM> is
|
155 |
|
|
specified). If one or more <EM>option</EM> - <EM>value</EM> pairs are
|
156 |
|
|
specified, then the command modifies the given widget
|
157 |
|
|
option(s) to have the given value(s); in this case the
|
158 |
|
|
command returns an empty string. <EM>Option</EM> may have any
|
159 |
|
|
of the values accepted by the <STRONG>buttonbox</STRONG> command.
|
160 |
|
|
|
161 |
|
|
<EM>pathName</EM> <STRONG>default</STRONG> <EM>index</EM>
|
162 |
|
|
Sets the default button to the button given by <EM>index</EM>.
|
163 |
|
|
This causes the default ring to appear arround the
|
164 |
|
|
specified button.
|
165 |
|
|
|
166 |
|
|
<EM>pathName</EM> <STRONG>delete</STRONG> <EM>index</EM>
|
167 |
|
|
Deletes the button given by <EM>index</EM> from the button box.
|
168 |
|
|
|
169 |
|
|
<EM>pathName</EM> <STRONG>hide</STRONG> <EM>index</EM>
|
170 |
|
|
Hides the button denoted by <EM>index</EM>. This doesn't remove
|
171 |
|
|
the button permanently, just inhibits its display.
|
172 |
|
|
|
173 |
|
|
<EM>pathName</EM> <STRONG>index</STRONG> <EM>index</EM>
|
174 |
|
|
Returns the numerical index corresponding to <EM>index</EM>.
|
175 |
|
|
|
176 |
|
|
<EM>pathName</EM> <STRONG>insert</STRONG> <EM>index</EM> <EM>tag</EM> ?<EM>option</EM> <EM>value</EM> <EM>option</EM> <EM>value</EM> ...?
|
177 |
|
|
Same as the <STRONG>add</STRONG> command except that it inserts the new
|
178 |
|
|
button just before the one given by <EM>index</EM>, instead of
|
179 |
|
|
appending to the end of the button box. The <EM>option</EM>,
|
180 |
|
|
and <EM>value</EM> arguments have the same interpretation as for
|
181 |
|
|
the <STRONG>add</STRONG> widget command.
|
182 |
|
|
|
183 |
|
|
<EM>pathName</EM> <STRONG>invoke</STRONG> ?<EM>index</EM>?
|
184 |
|
|
Invoke the command associated with a button. If no
|
185 |
|
|
arguments are given then the current default button is
|
186 |
|
|
invoked, otherwise the argument is expected to be a
|
187 |
|
|
button <EM>index</EM>.
|
188 |
|
|
|
189 |
|
|
<EM>pathName</EM> <STRONG>show</STRONG> <EM>index</EM>
|
190 |
|
|
Display a previously hidden button denoted by <EM>index</EM>.
|
191 |
|
|
|
192 |
|
|
|
193 |
|
|
</PRE>
|
194 |
|
|
<H2>EXAMPLE</H2><PRE>
|
195 |
|
|
buttonbox .bb
|
196 |
|
|
|
197 |
|
|
.bb add Yes -text Yes -command "puts Yes"
|
198 |
|
|
.bb add No -text No -command "puts No"
|
199 |
|
|
.bb add Maybe -text Maybe -command "puts Maybe"
|
200 |
|
|
.bb default Yes
|
201 |
|
|
|
202 |
|
|
pack .bb -expand yes -fill both
|
203 |
|
|
|
204 |
|
|
|
205 |
|
|
|
206 |
|
|
</PRE>
|
207 |
|
|
<H2>AUTHOR</H2><PRE>
|
208 |
|
|
Bret A. Schuhmacher
|
209 |
|
|
|
210 |
|
|
Mark L. Ulferts
|
211 |
|
|
|
212 |
|
|
|
213 |
|
|
</PRE>
|
214 |
|
|
<H2>KEYWORDS</H2><PRE>
|
215 |
|
|
buttonbox, pushbutton, button, widget
|
216 |
|
|
|
217 |
|
|
|
218 |
|
|
|
219 |
|
|
|
220 |
|
|
|
221 |
|
|
|
222 |
|
|
|
223 |
|
|
|
224 |
|
|
|
225 |
|
|
|
226 |
|
|
|
227 |
|
|
|
228 |
|
|
|
229 |
|
|
|
230 |
|
|
|
231 |
|
|
|
232 |
|
|
|
233 |
|
|
|
234 |
|
|
|
235 |
|
|
|
236 |
|
|
|
237 |
|
|
|
238 |
|
|
|
239 |
|
|
|
240 |
|
|
|
241 |
|
|
|
242 |
|
|
|
243 |
|
|
</PRE>
|
244 |
|
|
</BODY>
|
245 |
|
|
</HTML>
|