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 |
|
|
'\" @(#) scrolledtext.n 1.21 94/12/17 16:04:44
|
8 |
|
|
'/"
|
9 |
|
|
.so man.macros
|
10 |
|
|
.HS scrolledtext iwid
|
11 |
|
|
.BS
|
12 |
|
|
'\" Note: do not modify the .SH NAME line immediately below!
|
13 |
|
|
.SH NAME
|
14 |
|
|
scrolledtext \- Create and manipulate a scrolled text widget
|
15 |
|
|
.SH SYNOPSIS
|
16 |
|
|
\fBscrolledtext\fI \fIpathName \fR?\fIoptions\fR?
|
17 |
|
|
.SH "INHERITANCE"
|
18 |
|
|
itk::Widget <- Labeledwidget <- Scrolledwidget <- Scrolledtext
|
19 |
|
|
.SH "STANDARD OPTIONS"
|
20 |
|
|
.LP
|
21 |
|
|
.nf
|
22 |
|
|
.ta 4c 8c 12c
|
23 |
|
|
\fBactiveBackground\fR \fBbackground\fR \fBborderWidth\fR \fBcursor\fR
|
24 |
|
|
\fBexportSelection\fR \fBforeground\fR \fBhighlightColor\fR \fBhighlightThickness\fR
|
25 |
|
|
\fBinsertBackground\fR \fBinsertBorderWidth\fR \fBinsertOffTime\fR \fBinsertOnTime\fR
|
26 |
|
|
\fBinsertWidth\fR \fBpadX\fR \fBpadY\fR \fBrelief\fR
|
27 |
|
|
\fBselectBackground\fR \fBselectBorderWidth\fR \fBselectForeground\fR \fBsetGrid\fR
|
28 |
|
|
.fi
|
29 |
|
|
.LP
|
30 |
|
|
See the "options" manual entry for details on the standard options.
|
31 |
|
|
.SH "ASSOCIATED OPTIONS"
|
32 |
|
|
.LP
|
33 |
|
|
.nf
|
34 |
|
|
.ta 4c 8c 12c
|
35 |
|
|
\fBactiveRelief\fR \fBelementBorderWidth\fR \fBjump\fR \fBtroughColor\fR
|
36 |
|
|
.fi
|
37 |
|
|
.LP
|
38 |
|
|
See the "scrollbar" widget manual entry for details on the above
|
39 |
|
|
associated options.
|
40 |
|
|
.LP
|
41 |
|
|
.nf
|
42 |
|
|
.ta 4c 8c 12c
|
43 |
|
|
\fBspacing1\fR \fBspacing2\fR \fBspacing3\fR \fBstate\fR
|
44 |
|
|
\fBwrap\fR
|
45 |
|
|
.fi
|
46 |
|
|
.LP
|
47 |
|
|
See the "text" widget manual entry for details on the above
|
48 |
|
|
associated options.
|
49 |
|
|
.SH "INHERITED OPTIONS"
|
50 |
|
|
.LP
|
51 |
|
|
.nf
|
52 |
|
|
.ta 4c 8c 12c
|
53 |
|
|
\fBdisabledForeground\fR \fBlabelBitmap\fR \fBlabelFont\fR \fBlabelImage\fR
|
54 |
|
|
\fBlabelMargin\fR \fBlabelPos\fR \fBlabelText\fR \fBlabelVariable\fR
|
55 |
|
|
\fBstate\fR
|
56 |
|
|
.fi
|
57 |
|
|
.LP
|
58 |
|
|
See the "labeledwidget" class manual entry for details on the inherited options.
|
59 |
|
|
.SH "WIDGET-SPECIFIC OPTIONS"
|
60 |
|
|
.LP
|
61 |
|
|
.nf
|
62 |
|
|
Name: \fBheight\fR
|
63 |
|
|
Class: \fBHeight\fR
|
64 |
|
|
Command-Line Switch: \fB-height\fR
|
65 |
|
|
.fi
|
66 |
|
|
.IP
|
67 |
|
|
Specifies the height of the scrolled text as an entire unit.
|
68 |
|
|
The value may be specified in any of the forms acceptable to
|
69 |
|
|
\fBTk_GetPixels\fR. Any additional space needed to display the other
|
70 |
|
|
components such as labels, margins, and scrollbars force the text
|
71 |
|
|
to be compressed. A value of zero along with the same value for
|
72 |
|
|
the width causes the value given for the visibleitems option
|
73 |
|
|
to be applied which administers geometry constraints in a different
|
74 |
|
|
manner. The default height is zero.
|
75 |
|
|
.LP
|
76 |
|
|
.nf
|
77 |
|
|
Name: \fBhscrollMode\fR
|
78 |
|
|
Class: \fBScrollMode\fR
|
79 |
|
|
Command-Line Switch: \fB-hscrollmode\fR
|
80 |
|
|
.fi
|
81 |
|
|
.IP
|
82 |
|
|
Specifies the the display mode to be used for the horizontal
|
83 |
|
|
scrollbar: \fBstatic, dynamic,\fR or \fBnone\fR. In static mode, the
|
84 |
|
|
scroll bar is displayed at all times. Dynamic mode displays the
|
85 |
|
|
scroll bar as required, and none disables the scroll bar display. The
|
86 |
|
|
default is static.
|
87 |
|
|
.LP
|
88 |
|
|
.nf
|
89 |
|
|
Name: \fBsbWidth\fR
|
90 |
|
|
Class: \fBWidth\fR
|
91 |
|
|
Command-Line Switch: \fB-sbwidth\fR
|
92 |
|
|
.fi
|
93 |
|
|
.IP
|
94 |
|
|
Specifies the width of the scrollbar in any of the forms
|
95 |
|
|
acceptable to \fBTk_GetPixels\fR.
|
96 |
|
|
.LP
|
97 |
|
|
.nf
|
98 |
|
|
Name: \fBscrollMargin\fR
|
99 |
|
|
Class: \fBMargin\fR
|
100 |
|
|
Command-Line Switch: \fB-scrollmargin\fR
|
101 |
|
|
.fi
|
102 |
|
|
.IP
|
103 |
|
|
Specifies the distance between the text area and scrollbar in any of the forms
|
104 |
|
|
acceptable to \fBTk_GetPixels\fR. The default is 3 pixels.
|
105 |
|
|
.LP
|
106 |
|
|
.nf
|
107 |
|
|
Name: \fBtextBackground\fR
|
108 |
|
|
Class: \fBBackground\fR
|
109 |
|
|
Command-Line Switch: \fB-textbackground\fR
|
110 |
|
|
.fi
|
111 |
|
|
.IP
|
112 |
|
|
Specifies the background color for the text area in any of the forms
|
113 |
|
|
acceptable to \fBTk_GetColor\fR.
|
114 |
|
|
.LP
|
115 |
|
|
.nf
|
116 |
|
|
Name: \fBtextFont\fR
|
117 |
|
|
Class: \fBFont\fR
|
118 |
|
|
Command-Line Switch: \fB-textfont\fR
|
119 |
|
|
.fi
|
120 |
|
|
.IP
|
121 |
|
|
Specifies the font to be used in the scrolled text area.
|
122 |
|
|
.LP
|
123 |
|
|
.nf
|
124 |
|
|
Name: \fBvisibleitems\fR
|
125 |
|
|
Class: \fBVisibleItems\fR
|
126 |
|
|
Command-Line Switch: \fB-visibleitems\fR
|
127 |
|
|
.fi
|
128 |
|
|
.IP
|
129 |
|
|
Specifies the widthxheight in characters and lines for the text.
|
130 |
|
|
This option is only administered if the width and height options
|
131 |
|
|
are both set to zero, otherwise they take precedence. The default value
|
132 |
|
|
is 80x24. With the visibleitems option engaged, geometry constraints
|
133 |
|
|
are maintained only on the text. The size of the other components such as
|
134 |
|
|
labels, margins, and scroll bars, are additive and independent,
|
135 |
|
|
effecting the overall size of the scrolled text. In contrast,
|
136 |
|
|
should the width and height options have non zero values, they
|
137 |
|
|
are applied to the scrolled text as a whole. The text
|
138 |
|
|
is compressed or expanded to maintain the geometry constraints.
|
139 |
|
|
.LP
|
140 |
|
|
.nf
|
141 |
|
|
Name: \fBvscrollMode\fR
|
142 |
|
|
Class: \fBScrollMode\fR
|
143 |
|
|
Command-Line Switch: \fB-vscrollmode\fR
|
144 |
|
|
.fi
|
145 |
|
|
.IP
|
146 |
|
|
Specifies the the display mode to be used for the vertical
|
147 |
|
|
scrollbar: \fBstatic, dynamic,\fR or \fBnone\fR. In static mode, the
|
148 |
|
|
scroll bar is displayed at all times. Dynamic mode displays the
|
149 |
|
|
scroll bar as required, and none disables the scroll bar display. The
|
150 |
|
|
default is static.
|
151 |
|
|
.LP
|
152 |
|
|
.nf
|
153 |
|
|
Name: \fBwidth\fR
|
154 |
|
|
Class: \fBWidth\fR
|
155 |
|
|
Command-Line Switch: \fB-width\fR
|
156 |
|
|
.fi
|
157 |
|
|
.IP
|
158 |
|
|
Specifies the width of the scrolled text as an entire unit.
|
159 |
|
|
The value may be specified in any of the forms acceptable to
|
160 |
|
|
\fBTk_GetPixels\fR. Any additional space needed to display the other
|
161 |
|
|
components such as labels, margins, and scrollbars force the text
|
162 |
|
|
to be compressed. A value of zero along with the same value for
|
163 |
|
|
the height causes the value given for the visibleitems option
|
164 |
|
|
to be applied which administers geometry constraints in a different
|
165 |
|
|
manner. The default width is zero.
|
166 |
|
|
.LP
|
167 |
|
|
.BE
|
168 |
|
|
|
169 |
|
|
.SH DESCRIPTION
|
170 |
|
|
.PP
|
171 |
|
|
The \fBscrolledtext\fR command creates
|
172 |
|
|
a scrolled text widget with additional options to manage
|
173 |
|
|
the scrollbars. This includes options to control the method
|
174 |
|
|
in which the scrollbars are displayed, i.e. statically or dynamically.
|
175 |
|
|
Options also exist for adding a label to the scrolled text area and
|
176 |
|
|
controlling its position. Import/export of methods are provided for
|
177 |
|
|
file I/O.
|
178 |
|
|
|
179 |
|
|
.SH "METHODS"
|
180 |
|
|
.PP
|
181 |
|
|
The \fBscrolledtext\fR command creates a new Tcl command whose
|
182 |
|
|
name is \fIpathName\fR. This
|
183 |
|
|
command may be used to invoke various
|
184 |
|
|
operations on the widget. It has the following general form:
|
185 |
|
|
.DS C
|
186 |
|
|
\fIpathName option \fR?\fIarg arg ...\fR?
|
187 |
|
|
.DE
|
188 |
|
|
\fIOption\fR and the \fIarg\fRs
|
189 |
|
|
determine the exact behavior of the command. The following
|
190 |
|
|
commands are possible for scrolledtext widgets:
|
191 |
|
|
.SH "ASSOCIATED METHODS"
|
192 |
|
|
.LP
|
193 |
|
|
.nf
|
194 |
|
|
.ta 4c 8c 12c
|
195 |
|
|
\fBbbox\fR \fBcompare\fR \fBdebug\fR \fBdelete\fR
|
196 |
|
|
\fBdlineinfo\fR \fBget\fR \fBindex\fR \fBinsert\fR
|
197 |
|
|
\fBmark\fR \fBscan\fR \fBsearch\fR \fBsee\fR
|
198 |
|
|
\fBtag\fR \fBwindow\fR \fBxview\fR \fByview\fR
|
199 |
|
|
.fi
|
200 |
|
|
.LP
|
201 |
|
|
See the "text" manual entry for details on the standard methods.
|
202 |
|
|
|
203 |
|
|
.SH "WIDGET-SPECIFIC METHODS"
|
204 |
|
|
.TP
|
205 |
|
|
\fIpathName \fBcget\fR \fIoption\fR
|
206 |
|
|
Returns the current value of the configuration option given
|
207 |
|
|
by \fIoption\fR.
|
208 |
|
|
\fIOption\fR may have any of the values accepted by the \fBscrolledtext\fR
|
209 |
|
|
command.
|
210 |
|
|
.TP
|
211 |
|
|
\fIpathName \fBchildsite\fR
|
212 |
|
|
Returns the child site widget path name.
|
213 |
|
|
.TP
|
214 |
|
|
\fIpathName \fBclear\fR
|
215 |
|
|
Clear the text area of all characters.
|
216 |
|
|
.TP
|
217 |
|
|
\fIpathName\fR \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
|
218 |
|
|
Query or modify the configuration options of the widget.
|
219 |
|
|
If no \fIoption\fR is specified, returns a list describing all of
|
220 |
|
|
the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
|
221 |
|
|
information on the format of this list). If \fIoption\fR is specified
|
222 |
|
|
with no \fIvalue\fR, then the command returns a list describing the
|
223 |
|
|
one named option (this list will be identical to the corresponding
|
224 |
|
|
sublist of the value returned if no \fIoption\fR is specified). If
|
225 |
|
|
one or more \fIoption\-value\fR pairs are specified, then the command
|
226 |
|
|
modifies the given widget option(s) to have the given value(s); in
|
227 |
|
|
this case the command returns an empty string.
|
228 |
|
|
\fIOption\fR may have any of the values accepted by the \fBscrolledtext\fR
|
229 |
|
|
command.
|
230 |
|
|
.TP
|
231 |
|
|
\fIpathName \fBimport\fR \fIfilename\fR ?\fIindex\fR?
|
232 |
|
|
Load the text from a file into the text area at the \fIindex\fR. The
|
233 |
|
|
\fIfilename\fR must exist.
|
234 |
|
|
.TP
|
235 |
|
|
\fIpathName \fBexport\fR \fIfilename\fR
|
236 |
|
|
Write text to a file. If \fIfilename\fR exists then contents are
|
237 |
|
|
replaced with text widget contents.
|
238 |
|
|
|
239 |
|
|
.SH "COMPONENTS"
|
240 |
|
|
.LP
|
241 |
|
|
.nf
|
242 |
|
|
Name: \fBtext\fR
|
243 |
|
|
Class: \fBText\fR
|
244 |
|
|
.fi
|
245 |
|
|
.IP
|
246 |
|
|
The text component is the text widget. See the "text" widget
|
247 |
|
|
manual entry for details on the text component item.
|
248 |
|
|
.LP
|
249 |
|
|
.nf
|
250 |
|
|
Name: \fBhorizsb\fR
|
251 |
|
|
Class: \fBScrollbar\fR
|
252 |
|
|
.fi
|
253 |
|
|
.IP
|
254 |
|
|
The horizsb component is the horizontal scroll bar. See the "scrollbar"
|
255 |
|
|
widget manual entry for details on the horizsb component item.
|
256 |
|
|
.LP
|
257 |
|
|
.nf
|
258 |
|
|
Name: \fBvertsb\fR
|
259 |
|
|
Class: \fBScrollbar\fR
|
260 |
|
|
.fi
|
261 |
|
|
.IP
|
262 |
|
|
The vertsb component is the vertical scroll bar. See the "scrollbar" widget
|
263 |
|
|
manual entry for details on the vertsb component item.
|
264 |
|
|
.fi
|
265 |
|
|
|
266 |
|
|
.SH EXAMPLE
|
267 |
|
|
.DS
|
268 |
|
|
option add *textBackground white
|
269 |
|
|
|
270 |
|
|
scrolledtext .st -scrollmode dynamic -labeltext "Password File"
|
271 |
|
|
|
272 |
|
|
pack .st -padx 10 -pady 10 -fill both -expand yes
|
273 |
|
|
|
274 |
|
|
.st import /etc/passwd
|
275 |
|
|
.DE
|
276 |
|
|
.SH AUTHOR
|
277 |
|
|
Mark L. Ulferts
|
278 |
|
|
.SH KEYWORDS
|
279 |
|
|
scrolledtext, text, widget
|