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