1 |
578 |
markom |
'\"
|
2 |
|
|
'\" Copyright (c) 1995 DSC Technologies Corporation
|
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 |
|
|
'\" @(#) labeledwidget.n 1.21 94/12/17 16:04:44
|
8 |
|
|
'/"
|
9 |
|
|
.so man.macros
|
10 |
|
|
.HS labeledwidget iwid
|
11 |
|
|
.BS
|
12 |
|
|
'\" Note: do not modify the .SH NAME line immediately below!
|
13 |
|
|
.SH NAME
|
14 |
|
|
labeledwidget \- Create and manipulate a labeled widget
|
15 |
|
|
.SH SYNOPSIS
|
16 |
|
|
\fBlabeledwidget\fI \fIpathName \fR?\fIoptions\fR?
|
17 |
|
|
.SH "INHERITANCE"
|
18 |
|
|
itk::Widget <- labeledwidget
|
19 |
|
|
.SH "STANDARD OPTIONS"
|
20 |
|
|
.LP
|
21 |
|
|
.nf
|
22 |
|
|
.ta 4c 8c 12c
|
23 |
|
|
\fBbackground\fR \fBcursor\fR \fBforeground\fR
|
24 |
|
|
.fi
|
25 |
|
|
.LP
|
26 |
|
|
See the "options" manual entry for details on the standard options.
|
27 |
|
|
.SH "WIDGET-SPECIFIC OPTIONS"
|
28 |
|
|
.LP
|
29 |
|
|
.nf
|
30 |
|
|
Name: \fBdisabledForeground\fR
|
31 |
|
|
Class: \fBDisabledForeground\fR
|
32 |
|
|
Command-Line Switch: \fB-disabledforeground\fR
|
33 |
|
|
.fi
|
34 |
|
|
.IP
|
35 |
|
|
Specifies the foreground to be used when the state is disabled.
|
36 |
|
|
.LP
|
37 |
|
|
.nf
|
38 |
|
|
Name: \fBlabelBitmap\fR
|
39 |
|
|
Class: \fBBitmap\fR
|
40 |
|
|
Command-Line Switch: \fB-labelbitmap\fR
|
41 |
|
|
.fi
|
42 |
|
|
.IP
|
43 |
|
|
Specifies a bitmap to display in the widget, in any of the forms
|
44 |
|
|
acceptable to \fBTk_GetBitmap\fR. This option overrides the \fIlabeltext\fR
|
45 |
|
|
option.
|
46 |
|
|
.LP
|
47 |
|
|
.nf
|
48 |
|
|
Name: \fBlabelFont\fR
|
49 |
|
|
Class: \fBFont\fR
|
50 |
|
|
Command-Line Switch: \fB-labelfont\fR
|
51 |
|
|
.fi
|
52 |
|
|
.IP
|
53 |
|
|
Specifies the font to be used for the label.
|
54 |
|
|
.LP
|
55 |
|
|
.nf
|
56 |
|
|
Name: \fBlabelImage\fR
|
57 |
|
|
Class: \fBImage\fR
|
58 |
|
|
Command-Line Switch: \fB-labelimage\fR
|
59 |
|
|
.fi
|
60 |
|
|
.IP
|
61 |
|
|
Specifies a image to be used as the label. The image may be any of the
|
62 |
|
|
values created by the \fBimage create\fR command. This option overrides
|
63 |
|
|
both the \fIlabelbitmap\fR and \fIlabeletext\fR options.
|
64 |
|
|
.LP
|
65 |
|
|
.nf
|
66 |
|
|
Name: \fBlabelMargin\fR
|
67 |
|
|
Class: \fBMargin\fR
|
68 |
|
|
Command-Line Switch: \fB-labelmargin\fR
|
69 |
|
|
.fi
|
70 |
|
|
.IP
|
71 |
|
|
Specifies the distance between the childsite and label in any of the forms
|
72 |
|
|
acceptable to \fBTk_GetPixels\fR. The default is 2 pixel.
|
73 |
|
|
.LP
|
74 |
|
|
.nf
|
75 |
|
|
Name: \fBlabelPos\fR
|
76 |
|
|
Class: \fBPosition\fR
|
77 |
|
|
Command-Line Switch: \fB-labelpos\fR
|
78 |
|
|
.fi
|
79 |
|
|
.IP
|
80 |
|
|
Specifies the position of the label along the side of the childsite:
|
81 |
|
|
\fBnw\fR, \fBn\fR, \fBne\fR, \fBsw\fR, \fBs\fR, \fBse\fR, \fBen\fR, \fBe\fR,
|
82 |
|
|
\fBes\fR, \fBwn\fR, \fBw\fR, or \fBws\fR. The default is w.
|
83 |
|
|
.LP
|
84 |
|
|
.nf
|
85 |
|
|
Name: \fBlabelText\fR
|
86 |
|
|
Class: \fBText\fR
|
87 |
|
|
Command-Line Switch: \fB-labeltext\fR
|
88 |
|
|
.fi
|
89 |
|
|
.IP
|
90 |
|
|
Specifies the text of the label around the childsite.
|
91 |
|
|
.LP
|
92 |
|
|
.nf
|
93 |
|
|
Name: \fBlabelVariable\fR
|
94 |
|
|
Class: \fBVariable\fR
|
95 |
|
|
Command-Line Switch: \fB-labelvariable\fR
|
96 |
|
|
.fi
|
97 |
|
|
.IP
|
98 |
|
|
Specifies the text variable of the label around the childsite.
|
99 |
|
|
.LP
|
100 |
|
|
.nf
|
101 |
|
|
Name: \fBstate\fR
|
102 |
|
|
Class: \fBState\fR
|
103 |
|
|
Command-Line Switch: \fB-state\fR
|
104 |
|
|
.fi
|
105 |
|
|
.IP
|
106 |
|
|
Specifies one of two states for the label: \fBnormal\fR or \fBdisabled\fR.
|
107 |
|
|
If the label is disabled then it is displayed in a disabled foreground
|
108 |
|
|
color. The default is normal.
|
109 |
|
|
.LP
|
110 |
|
|
.BE
|
111 |
|
|
|
112 |
|
|
.SH DESCRIPTION
|
113 |
|
|
.PP
|
114 |
|
|
The \fBlabeledwidget\fR command creates a labeled widget which contains
|
115 |
|
|
a label and child site. The child site is a frame
|
116 |
|
|
which can filled with any widget via a derived class or though the use
|
117 |
|
|
of the childsite method. This class
|
118 |
|
|
was designed to be a general purpose base class for supporting the
|
119 |
|
|
combination of label widget and a childsite. The options include the
|
120 |
|
|
ability to position the label around the childsite widget, modify the
|
121 |
|
|
font and margin, and control the display of the labels.
|
122 |
|
|
|
123 |
|
|
.SH "METHODS"
|
124 |
|
|
.PP
|
125 |
|
|
The \fBlabeledwidget\fR command creates a new Tcl command whose
|
126 |
|
|
name is \fIpathName\fR. This
|
127 |
|
|
command may be used to invoke various
|
128 |
|
|
operations on the widget. It has the following general form:
|
129 |
|
|
.DS C
|
130 |
|
|
\fIpathName option \fR?\fIarg arg ...\fR?
|
131 |
|
|
.DE
|
132 |
|
|
\fIOption\fR and the \fIarg\fRs
|
133 |
|
|
determine the exact behavior of the command. The following
|
134 |
|
|
commands are possible for labeledwidget widgets:
|
135 |
|
|
.SH "WIDGET-SPECIFIC METHODS"
|
136 |
|
|
.TP
|
137 |
|
|
\fIpathName \fBchildsite\fR
|
138 |
|
|
Return the path name of the child site.
|
139 |
|
|
.TP
|
140 |
|
|
\fIpathName \fBcget\fR \fIoption\fR
|
141 |
|
|
Returns the current value of the configuration option given
|
142 |
|
|
by \fIoption\fR.
|
143 |
|
|
\fIOption\fR may have any of the values accepted by the \fBlabeledwidget\fR
|
144 |
|
|
command.
|
145 |
|
|
.TP
|
146 |
|
|
\fIpathName\fR \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
|
147 |
|
|
Query or modify the configuration options of the widget.
|
148 |
|
|
If no \fIoption\fR is specified, returns a list describing all of
|
149 |
|
|
the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
|
150 |
|
|
information on the format of this list). If \fIoption\fR is specified
|
151 |
|
|
with no \fIvalue\fR, then the command returns a list describing the
|
152 |
|
|
one named option (this list will be identical to the corresponding
|
153 |
|
|
sublist of the value returned if no \fIoption\fR is specified). If
|
154 |
|
|
one or more \fIoption\-value\fR pairs are specified, then the command
|
155 |
|
|
modifies the given widget option(s) to have the given value(s); in
|
156 |
|
|
this case the command returns an empty string.
|
157 |
|
|
\fIOption\fR may have any of the values accepted by the \fBlabeledwidget\fR
|
158 |
|
|
command.
|
159 |
|
|
|
160 |
|
|
.SH "STATIC METHODS"
|
161 |
|
|
.TP
|
162 |
|
|
\fBLabeledwidget::alignlabels\fR \fIwidget\fR ?\fIwidget ...\fR?
|
163 |
|
|
The alignlabels procedure takes a list of widgets derived from
|
164 |
|
|
the Labeledwidget class and uses the label margin to make each widget
|
165 |
|
|
have the same total space for the combination of label and margin. The
|
166 |
|
|
net effect is to left align the labels. Generally, this method is only
|
167 |
|
|
useful with a label position of w, which is the default.
|
168 |
|
|
|
169 |
|
|
.SH "COMPONENTS"
|
170 |
|
|
.LP
|
171 |
|
|
.nf
|
172 |
|
|
Name: \fBlabel\fR
|
173 |
|
|
Class: \fBlabel\fR
|
174 |
|
|
.fi
|
175 |
|
|
.IP
|
176 |
|
|
The label component provides the label for the labeled widget. See the
|
177 |
|
|
"label" widget manual entry for details on the label component item.
|
178 |
|
|
.LP
|
179 |
|
|
.nf
|
180 |
|
|
Name: \fBlwchildsite\fR
|
181 |
|
|
Class: \fBframe\fR
|
182 |
|
|
.fi
|
183 |
|
|
.IP
|
184 |
|
|
The lwchildsite component is the user child site for the labeled widget. See
|
185 |
|
|
the "frame" widget manual entry for details on the lwchildsite component item.
|
186 |
|
|
.fi
|
187 |
|
|
|
188 |
|
|
.SH EXAMPLE
|
189 |
|
|
.IP
|
190 |
|
|
The labeledwidget was primarily meant to be a base class. The
|
191 |
|
|
ScrolledListBox and EntryField are good examples of derived
|
192 |
|
|
classes of the labeledwidget class. In order to provide equal
|
193 |
|
|
support for composite classes, the 'childsite' methods also exists.
|
194 |
|
|
The following is an example of 'childsite' method usage.
|
195 |
|
|
.LP
|
196 |
|
|
.DS
|
197 |
|
|
labeledwidget .lw -labeltext "Canvas Widget" -labelpos s
|
198 |
|
|
pack .lw -fill both -expand yes -padx 10 -pady 10
|
199 |
|
|
|
200 |
|
|
set cw [canvas [.lw childsite].c -relief raised -width 200 -height 200]
|
201 |
|
|
pack $cw -padx 10 -pady 10
|
202 |
|
|
.DE
|
203 |
|
|
.SH AUTHOR
|
204 |
|
|
Mark L. Ulferts
|
205 |
|
|
.SH KEYWORDS
|
206 |
|
|
labeledwidget, widget
|