1<TITLE>labeledwidget - Create and manipulate a labeled widget</TITLE>
2<H1>labeledwidget - Create and manipulate a labeled widget</H1>
3
4</pre><H2>SYNOPSIS</H2>
5<B>labeledwidget<I> <I>pathName </I>?<I>options</I>?
6</pre><H2>INHERITANCE</H2>
7itk::Widget &lt;- labeledwidget
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<B>foreground</B><br>
19</td>
20<td valign=top>
21</td>
22</table>
23<P>
24See 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.
25</pre><H2>WIDGET-SPECIFIC OPTIONS</H2>
26<P>
27<pre>
28Name:                   <B>disabledForeground</B>
29Class:                  <B>DisabledForeground</B>
30Command-Line Switch:	<B>-disabledforeground</B>
31</pre>
32<UL>
33Specifies the foreground to be used when the state is disabled. 
34</UL>
35<P>
36<pre>
37Name:                   <B>labelBitmap</B>
38Class:                  <B>Bitmap</B>
39Command-Line Switch:	<B>-labelbitmap</B>
40</pre>
41<UL>
42Specifies a bitmap to display in the widget, in any of the forms 
43acceptable to <B>Tk_GetBitmap</B>.  This option overrides the <I>labeltext</I>
44option.
45</UL>
46<P>
47<pre>
48Name:                   <B>labelFont</B>
49Class:                  <B>Font</B>
50Command-Line Switch:	<B>-labelfont</B>
51</pre>
52<UL>
53Specifies the font to be used for the label.
54</UL>
55<P>
56<pre>
57Name:                   <B>labelImage</B>
58Class:                  <B>Image</B>
59Command-Line Switch:	<B>-labelimage</B>
60</pre>
61<UL>
62Specifies a image to be used as the label. The image may be any of the
63values created by the <B>image create</B> command.  This option overrides
64both the <I>labelbitmap</I> and <I>labeletext</I> options.
65</UL>
66<P>
67<pre>
68Name:                   <B>labelMargin</B>
69Class:                  <B>Margin</B>
70Command-Line Switch:	<B>-labelmargin</B>
71</pre>
72<UL>
73Specifies the distance between the childsite and label in any of the forms
74acceptable to <B>Tk_GetPixels</B>.  The default is 2 pixel.
75</UL>
76<P>
77<pre>
78Name:                   <B>labelPos</B>
79Class:                  <B>Position</B>
80Command-Line Switch:	<B>-labelpos</B>
81</pre>
82<UL>
83Specifies the position of the label along the side of the childsite: 
84<B>nw</B>, <B>n</B>, <B>ne</B>, <B>sw</B>, <B>s</B>, <B>se</B>, <B>en</B>, <B>e</B>, 
85<B>es</B>, <B>wn</B>, <B>w</B>, or <B>ws</B>.  The default is w.
86</UL>
87<P>
88<pre>
89Name:                   <B>labelText</B>
90Class:                  <B>Text</B>
91Command-Line Switch:	<B>-labeltext</B>
92</pre>
93<UL>
94Specifies the text of the label around the childsite.
95</UL>
96<P>
97<pre>
98Name:                   <B>labelVariable</B>
99Class:                  <B>Variable</B>
100Command-Line Switch:	<B>-labelvariable</B>
101</pre>
102<UL>
103Specifies the text variable of the label around the childsite.
104</UL>
105<P>
106<pre>
107Name:                   <B>state</B>
108Class:                  <B>State</B>
109Command-Line Switch:	<B>-state</B>
110</pre>
111<UL>
112Specifies one of two states for the label: <B>normal</B> or <B>disabled</B>.
113If the label is disabled then it is displayed in a disabled foreground
114color.  The default is normal.
115</UL>
116<P>
117</pre><HR>
118
119</pre><H2>DESCRIPTION</H2>
120<P>
121The <B>labeledwidget</B> command creates a labeled widget which contains 
122a label and child site.  The child site is a frame 
123which can filled with any widget via a derived class or though the use 
124of the childsite method.  This class
125was designed to be a general purpose base class for supporting the 
126combination of label widget and a childsite.  The options include the
127ability to position the label around the childsite widget, modify the
128font and margin, and control the display of the labels.
129
130</pre><H2>METHODS</H2>
131<P>
132The <B>labeledwidget</B> command creates a new Tcl command whose
133name is <I>pathName</I>.  This
134command may be used to invoke various
135operations on the widget.  It has the following general form:
136<pre>
137<I>pathName option </I>?<I>arg arg ...</I>?
138</pre>
139<I>Option</I> and the <I>arg</I>s
140determine the exact behavior of the command.  The following
141commands are possible for labeledwidget widgets:
142</pre><H2>WIDGET-SPECIFIC METHODS</H2>
143<DL>
144<DT> <I>pathName <B>childsite</B>
145</I></B>
146<DD> Return the path name of the child site.
147</DL>
148<DL>
149<DT> <I>pathName <B>cget</B> <I>option</I>
150</I></B>
151<DD> Returns the current value of the configuration option given
152by <I>option</I>.
153<I>Option</I> may have any of the values accepted by the <B>labeledwidget</B>
154command.
155</DL>
156<DL>
157<DT> <I>pathName</I> <B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?
158</I></B>
159<DD> Query or modify the configuration options of the widget.
160If no <I>option</I> is specified, returns a list describing all of
161the available options for <I>pathName</I> (see <B>Tk_ConfigureInfo</B> for
162information on the format of this list).  If <I>option</I> is specified
163with no <I>value</I>, then the command returns a list describing the
164one named option (this list will be identical to the corresponding
165sublist of the value returned if no <I>option</I> is specified).  If
166one or more <I>option-value</I> pairs are specified, then the command
167modifies the given widget option(s) to have the given value(s);  in
168this case the command returns an empty string.
169<I>Option</I> may have any of the values accepted by the <B>labeledwidget</B>
170command.
171
172</DL>
173</pre><H2>STATIC METHODS</H2>
174<DL>
175<DT> <B>Labeledwidget::alignlabels</B> <I>widget</I> ?<I>widget ...</I>?
176</I></B>
177<DD> The alignlabels procedure takes a list of widgets derived from
178the Labeledwidget class and uses the label margin to make each widget
179have the same total space for the combination of label and margin.  The
180net effect is to left align the labels.  Generally, this method is only 
181useful with a label position of w, which is the default.
182
183</DL>
184</pre><H2>COMPONENTS</H2>
185<P>
186<pre>
187Name:                   <B>label</B>
188Class:                  <B>label</B>
189</pre>
190<UL>
191The label component provides the label for the labeled widget.  See the 
192"label" widget manual entry for details on the label component item.
193</UL>
194<P>
195<pre>
196Name:                   <B>lwchildsite</B>
197Class:                  <B>frame</B>
198</pre>
199<UL>
200The lwchildsite component is the user child site for the labeled widget.  See 
201the "frame" widget manual entry for details on the lwchildsite component item.
202</UL>
203</table>
204
205</pre><H2>EXAMPLE</H2>
206<UL>
207The labeledwidget was primarily meant to be a base class.  The
208ScrolledListBox and EntryField are good examples of derived
209classes of the labeledwidget class.  In order to provide equal
210support for composite classes, the 'childsite' methods also exists.
211The following is an example of 'childsite' method usage.
212</UL>
213<P>
214<pre>
215 labeledwidget .lw -labeltext "Canvas Widget" -labelpos s
216 pack .lw -fill both -expand yes -padx 10 -pady 10
217
218 set cw [canvas [.lw childsite].c -relief raised -width 200 -height 200]
219 pack $cw -padx 10 -pady 10
220</pre>
221</pre><H2>AUTHOR</H2>
222Mark L. Ulferts
223</pre><H2>KEYWORDS</H2>
224labeledwidget, widget
225