1 |
578 |
markom |
<HTML>
|
2 |
|
|
<HEAD>
|
3 |
|
|
<TITLE>iwidgets2.2.0 User Commands - scrolledtext</TITLE>
|
4 |
|
|
</HEAD>
|
5 |
|
|
<BODY BGCOLOR="#FFFFFF">
|
6 |
|
|
<H1>iwidgets2.2.0 User Commands - scrolledtext</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 |
|
|
scrolledtext - Create and manipulate a scrolled text widget
|
17 |
|
|
|
18 |
|
|
|
19 |
|
|
</PRE>
|
20 |
|
|
<H2>SYNOPSIS</H2><PRE>
|
21 |
|
|
<STRONG>scrolledtext</STRONG> <EM>pathName</EM> ?<EM>options</EM>?
|
22 |
|
|
|
23 |
|
|
|
24 |
|
|
</PRE>
|
25 |
|
|
<H2>INHERITANCE</H2><PRE>
|
26 |
|
|
itk::Widget <- Labeledwidget <- Scrolledtext
|
27 |
|
|
|
28 |
|
|
|
29 |
|
|
</PRE>
|
30 |
|
|
<H2>STANDARD OPTIONS</H2><PRE>
|
31 |
|
|
<STRONG>activeBackground</STRONG> <STRONG>background</STRONG> <STRONG>borderWidthcursor</STRONG>
|
32 |
|
|
<STRONG>exportSelection</STRONG> <STRONG>foreground</STRONG> <STRONG>highlightColor</STRONG> <STRONG>highlightThickness</STRONG>
|
33 |
|
|
<STRONG>insertBackground</STRONG> <STRONG>insertBorderWidthinsertOffTimeinsertOnTime</STRONG>
|
34 |
|
|
<STRONG>insertWidth</STRONG> <STRONG>padX</STRONG> <STRONG>padY</STRONG> <STRONG>relief</STRONG>
|
35 |
|
|
<STRONG>repeatDelay</STRONG> <STRONG>repeatInterval</STRONG> <STRONG>selectBackgroundselectBorderWidth</STRONG>
|
36 |
|
|
<STRONG>selectForeground</STRONG> <STRONG>setGrid</STRONG>
|
37 |
|
|
|
38 |
|
|
See the "options" manual entry for details on the standard
|
39 |
|
|
options.
|
40 |
|
|
|
41 |
|
|
|
42 |
|
|
</PRE>
|
43 |
|
|
<H2>ASSOCIATED OPTIONS</H2><PRE>
|
44 |
|
|
<STRONG>activeRelief</STRONG> <STRONG>elementBorderWidth</STRONG> <STRONG>jumptroughColor</STRONG>
|
45 |
|
|
|
46 |
|
|
See the "scrollbar" widget manual entry for details on the
|
47 |
|
|
above associated options.
|
48 |
|
|
|
49 |
|
|
<STRONG>spacing1</STRONG> <STRONG>spacing2</STRONG> <STRONG>spacing3</STRONG> <STRONG>state</STRONG>
|
50 |
|
|
<STRONG>wrap</STRONG>
|
51 |
|
|
|
52 |
|
|
See the "text" widget manual entry for details on the above
|
53 |
|
|
associated options.
|
54 |
|
|
|
55 |
|
|
|
56 |
|
|
</PRE>
|
57 |
|
|
<H2>INHERITED OPTIONS</H2><PRE>
|
58 |
|
|
<STRONG>labelBitmap</STRONG> <STRONG>labelFont</STRONG> <STRONG>labelImage</STRONG> <STRONG>labelMargin</STRONG>
|
59 |
|
|
<STRONG>labelPos</STRONG> <STRONG>labelText</STRONG> <STRONG>labelVariable</STRONG>
|
60 |
|
|
|
61 |
|
|
See the "labeledwidget" class manual entry for details on
|
62 |
|
|
the inherited options.
|
63 |
|
|
|
64 |
|
|
|
65 |
|
|
</PRE>
|
66 |
|
|
<H2>WIDGET-SPECIFIC OPTIONS</H2><PRE>
|
67 |
|
|
Name: <STRONG>height</STRONG>
|
68 |
|
|
Class: <STRONG>Height</STRONG>
|
69 |
|
|
Command-Line Switch: <STRONG>-height</STRONG>
|
70 |
|
|
|
71 |
|
|
Specifies the height of the scrolled text as an entire
|
72 |
|
|
unit. The value may be specified in any of the forms
|
73 |
|
|
acceptable to <STRONG>Tk_GetPixels</STRONG>. Any additional space
|
74 |
|
|
needed to display the other components such as labels,
|
75 |
|
|
margins, and scrollbars force the text to be
|
76 |
|
|
compressed. A value of zero along with the same value
|
77 |
|
|
for the width causes the value given for the visi-
|
78 |
|
|
bleitems option to be applied which administers
|
79 |
|
|
geometry constraints in a different manner. The
|
80 |
|
|
default height is zero.
|
81 |
|
|
|
82 |
|
|
Name: <STRONG>hscrollMode</STRONG>
|
83 |
|
|
Class: <STRONG>ScrollMode</STRONG>
|
84 |
|
|
Command-Line Switch: <STRONG>-hscrollmode</STRONG>
|
85 |
|
|
|
86 |
|
|
Specifies the the display mode to be used for the hor-
|
87 |
|
|
izontal scrollbar: <STRONG>static,</STRONG> <STRONG>dynamic,</STRONG> or <STRONG>none</STRONG>. In static
|
88 |
|
|
mode, the scroll bar is displayed at all times.
|
89 |
|
|
Dynamic mode displays the scroll bar as required, and
|
90 |
|
|
none disables the scroll bar display. The default is
|
91 |
|
|
static.
|
92 |
|
|
|
93 |
|
|
Name: <STRONG>sbWidth</STRONG>
|
94 |
|
|
Class: <STRONG>Width</STRONG>
|
95 |
|
|
Command-Line Switch: <STRONG>-sbwidth</STRONG>
|
96 |
|
|
|
97 |
|
|
Specifies the width of the scrollbar in any of the
|
98 |
|
|
forms acceptable to <STRONG>Tk_GetPixels</STRONG>.
|
99 |
|
|
|
100 |
|
|
Name: <STRONG>scrollMargin</STRONG>
|
101 |
|
|
Class: <STRONG>Margin</STRONG>
|
102 |
|
|
Command-Line Switch: <STRONG>-scrollmargin</STRONG>
|
103 |
|
|
|
104 |
|
|
Specifies the distance between the text area and
|
105 |
|
|
scrollbar in any of the forms acceptable to
|
106 |
|
|
<STRONG>Tk_GetPixels</STRONG>. The default is 3 pixels.
|
107 |
|
|
|
108 |
|
|
Name: <STRONG>textBackground</STRONG>
|
109 |
|
|
Class: <STRONG>Background</STRONG>
|
110 |
|
|
Command-Line Switch: <STRONG>-textbackground</STRONG>
|
111 |
|
|
|
112 |
|
|
Specifies the background color for the text area in any
|
113 |
|
|
of the forms acceptable to <STRONG>Tk_GetColor</STRONG>.
|
114 |
|
|
|
115 |
|
|
Name: <STRONG>textFont</STRONG>
|
116 |
|
|
Class: <STRONG>Font</STRONG>
|
117 |
|
|
Command-Line Switch: <STRONG>-textfont</STRONG>
|
118 |
|
|
|
119 |
|
|
Specifies the font to be used in the scrolled text
|
120 |
|
|
area.
|
121 |
|
|
|
122 |
|
|
Name: <STRONG>visibleitems</STRONG>
|
123 |
|
|
Class: <STRONG>VisibleItems</STRONG>
|
124 |
|
|
Command-Line Switch: <STRONG>-visibleitems</STRONG>
|
125 |
|
|
|
126 |
|
|
Specifies the widthxheight in characters and lines for
|
127 |
|
|
the text. This option is only administered if the
|
128 |
|
|
width and height options are both set to zero,
|
129 |
|
|
otherwise they take precedence. The default value is
|
130 |
|
|
80x24. With the visibleitems option engaged, geometry
|
131 |
|
|
constraints are maintained only on the text. The size
|
132 |
|
|
of the other components such as labels, margins, and
|
133 |
|
|
scroll bars, are additive and independent, effecting
|
134 |
|
|
the overall size of the scrolled text. In contrast,
|
135 |
|
|
should the width and height options have non zero
|
136 |
|
|
values, they are applied to the scrolled text as a
|
137 |
|
|
whole. The text is compressed or expanded to maintain
|
138 |
|
|
the geometry constraints.
|
139 |
|
|
|
140 |
|
|
Name: <STRONG>vscrollMode</STRONG>
|
141 |
|
|
Class: <STRONG>ScrollMode</STRONG>
|
142 |
|
|
Command-Line Switch: <STRONG>-vscrollmode</STRONG>
|
143 |
|
|
|
144 |
|
|
Specifies the the display mode to be used for the vert-
|
145 |
|
|
ical scrollbar: <STRONG>static,</STRONG> <STRONG>dynamic,</STRONG> or <STRONG>none</STRONG>. In static
|
146 |
|
|
mode, the scroll bar is displayed at all times.
|
147 |
|
|
Dynamic mode displays the scroll bar as required, and
|
148 |
|
|
none disables the scroll bar display. The default is
|
149 |
|
|
static.
|
150 |
|
|
|
151 |
|
|
Name: <STRONG>width</STRONG>
|
152 |
|
|
Class: <STRONG>Width</STRONG>
|
153 |
|
|
Command-Line Switch: <STRONG>-width</STRONG>
|
154 |
|
|
|
155 |
|
|
Specifies the width of the scrolled text as an entire
|
156 |
|
|
unit. The value may be specified in any of the forms
|
157 |
|
|
acceptable to <STRONG>Tk_GetPixels</STRONG>. Any additional space
|
158 |
|
|
needed to display the other components such as labels,
|
159 |
|
|
margins, and scrollbars force the text to be
|
160 |
|
|
compressed. A value of zero along with the same value
|
161 |
|
|
for the height causes the value given for the visi-
|
162 |
|
|
bleitems option to be applied which administers
|
163 |
|
|
geometry constraints in a different manner. The
|
164 |
|
|
default width is zero.
|
165 |
|
|
|
166 |
|
|
|
167 |
|
|
</PRE>
|
168 |
|
|
<H2><HR ALIGN=LEFT WIDTH=70% SIZE=3></H2><PRE>
|
169 |
|
|
|
170 |
|
|
|
171 |
|
|
|
172 |
|
|
</PRE>
|
173 |
|
|
<H2>DESCRIPTION</H2><PRE>
|
174 |
|
|
The <STRONG>scrolledtext</STRONG> command creates a scrolled text widget with
|
175 |
|
|
additional options to manage the scrollbars. This includes
|
176 |
|
|
options to control the method in which the scrollbars are
|
177 |
|
|
displayed, i.e. statically or dynamically. Options also
|
178 |
|
|
exist for adding a label to the scrolled text area and con-
|
179 |
|
|
trolling its position. Import/export of methods are pro-
|
180 |
|
|
vided for file I/O.
|
181 |
|
|
|
182 |
|
|
|
183 |
|
|
|
184 |
|
|
</PRE>
|
185 |
|
|
<H2>METHODS</H2><PRE>
|
186 |
|
|
|
187 |
|
|
The <STRONG>scrolledtext</STRONG> command creates a new Tcl command whose
|
188 |
|
|
name is <EM>pathName</EM>. This command may be used to invoke vari-
|
189 |
|
|
ous operations on the widget. It has the following general
|
190 |
|
|
form:
|
191 |
|
|
|
192 |
|
|
<EM>pathName</EM> <EM>option</EM> ?<EM>arg</EM> <EM>arg</EM> ...?
|
193 |
|
|
|
194 |
|
|
<EM>Option</EM> and the <EM>arg</EM>s determine the exact behavior of the com-
|
195 |
|
|
mand. The following commands are possible for scrolledtext
|
196 |
|
|
widgets:
|
197 |
|
|
|
198 |
|
|
|
199 |
|
|
</PRE>
|
200 |
|
|
<H2>ASSOCIATED METHODS</H2><PRE>
|
201 |
|
|
<STRONG>bbox</STRONG> <STRONG>compare</STRONG> <STRONG>debug</STRONG> <STRONG>delete</STRONG>
|
202 |
|
|
<STRONG>dlineinfo</STRONG> <STRONG>get</STRONG> <STRONG>index</STRONG> <STRONG>insert</STRONG>
|
203 |
|
|
<STRONG>mark</STRONG> <STRONG>scan</STRONG> <STRONG>search</STRONG> <STRONG>see</STRONG>
|
204 |
|
|
<STRONG>tag</STRONG> <STRONG>window</STRONG> <STRONG>xview</STRONG> <STRONG>yview</STRONG>
|
205 |
|
|
|
206 |
|
|
See the "text" manual entry for details on the standard
|
207 |
|
|
methods.
|
208 |
|
|
|
209 |
|
|
|
210 |
|
|
|
211 |
|
|
</PRE>
|
212 |
|
|
<H2>WIDGET-SPECIFIC METHODS</H2><PRE>
|
213 |
|
|
<EM>pathName</EM> <STRONG>cget</STRONG> <EM>option</EM>
|
214 |
|
|
Returns the current value of the configuration option
|
215 |
|
|
given by <EM>option</EM>. <EM>Option</EM> may have any of the values
|
216 |
|
|
accepted by the <STRONG>scrolledtext</STRONG> command.
|
217 |
|
|
|
218 |
|
|
<EM>pathName</EM> <STRONG>clear</STRONG>
|
219 |
|
|
Clear the text area of all characters.
|
220 |
|
|
|
221 |
|
|
<EM>pathName</EM> <STRONG>configure</STRONG> ?<EM>option</EM>? ?<EM>value</EM> <EM>option</EM> <EM>value</EM> ...?
|
222 |
|
|
Query or modify the configuration options of the
|
223 |
|
|
widget. If no <EM>option</EM> is specified, returns a list
|
224 |
|
|
describing all of the available options for <EM>pathName</EM>
|
225 |
|
|
(see <STRONG>Tk_ConfigureInfo</STRONG> for information on the format of
|
226 |
|
|
this list). If <EM>option</EM> is specified with no <EM>value</EM>, then
|
227 |
|
|
the command returns a list describing the one named
|
228 |
|
|
option (this list will be identical to the correspond-
|
229 |
|
|
ing sublist of the value returned if no <EM>option</EM> is
|
230 |
|
|
specified). If one or more <EM>option</EM> - <EM>value</EM> pairs are
|
231 |
|
|
specified, then the command modifies the given widget
|
232 |
|
|
option(s) to have the given value(s); in this case the
|
233 |
|
|
command returns an empty string. <EM>Option</EM> may have any
|
234 |
|
|
of the values accepted by the <STRONG>scrolledtext</STRONG> command.
|
235 |
|
|
|
236 |
|
|
<EM>pathName</EM> <STRONG>import</STRONG> <EM>filename</EM>
|
237 |
|
|
Load text from a file. The <EM>filename</EM> must exist.
|
238 |
|
|
|
239 |
|
|
<EM>pathName</EM> <STRONG>export</STRONG> <EM>filename</EM>
|
240 |
|
|
Write text to a file. If <EM>filename</EM> exists then contents
|
241 |
|
|
are replaced with text widget contents.
|
242 |
|
|
|
243 |
|
|
|
244 |
|
|
</PRE>
|
245 |
|
|
<H2>COMPONENTS</H2><PRE>
|
246 |
|
|
Name: <STRONG>text</STRONG>
|
247 |
|
|
Class: <STRONG>Text</STRONG>
|
248 |
|
|
|
249 |
|
|
The text component is the text widget. See the "text"
|
250 |
|
|
widget manual entry for details on the text component
|
251 |
|
|
item.
|
252 |
|
|
|
253 |
|
|
Name: <STRONG>horizsb</STRONG>
|
254 |
|
|
Class: <STRONG>Scrollbar</STRONG>
|
255 |
|
|
|
256 |
|
|
The horizsb component is the horizontal scroll bar.
|
257 |
|
|
See the "scrollbar" widget manual entry for details on
|
258 |
|
|
the horizsb component item.
|
259 |
|
|
|
260 |
|
|
Name: <STRONG>vertsb</STRONG>
|
261 |
|
|
Class: <STRONG>Scrollbar</STRONG>
|
262 |
|
|
|
263 |
|
|
The vertsb component is the vertical scroll bar. See
|
264 |
|
|
the "scrollbar" widget manual entry for details on the
|
265 |
|
|
vertsb component item.
|
266 |
|
|
|
267 |
|
|
|
268 |
|
|
|
269 |
|
|
</PRE>
|
270 |
|
|
<H2>EXAMPLE</H2><PRE>
|
271 |
|
|
option add *textBackground white
|
272 |
|
|
|
273 |
|
|
scrolledtext .st -scrollmode dynamic -labeltext "Password File"
|
274 |
|
|
|
275 |
|
|
pack .st -padx 10 -pady 10 -fill both -expand yes
|
276 |
|
|
|
277 |
|
|
.st import /etc/passwd
|
278 |
|
|
|
279 |
|
|
|
280 |
|
|
|
281 |
|
|
</PRE>
|
282 |
|
|
<H2>AUTHOR</H2><PRE>
|
283 |
|
|
Mark L. Ulferts
|
284 |
|
|
|
285 |
|
|
|
286 |
|
|
</PRE>
|
287 |
|
|
<H2>KEYWORDS</H2><PRE>
|
288 |
|
|
scrolledtext, text, widget
|
289 |
|
|
|
290 |
|
|
|
291 |
|
|
|
292 |
|
|
|
293 |
|
|
|
294 |
|
|
|
295 |
|
|
|
296 |
|
|
|
297 |
|
|
|
298 |
|
|
|
299 |
|
|
|
300 |
|
|
|
301 |
|
|
|
302 |
|
|
|
303 |
|
|
</PRE>
|
304 |
|
|
</BODY>
|
305 |
|
|
</HTML>
|