1iwidgets::scrolledtext  −  Create  and manipulate a scrolled text
2widget iwidgets::scrolledtext pathName ?options?  itk::Widget  <‐
3iwidgets::Labeledwidget   <‐  iwidgets::Scrolledwidget  <‐  iwid‐
4gets::Scrolledtext

activeBackground background borderWidthcursor

exportSelection foreground highlightColor

highlightThickness insertBackground

insertBorderWidth insertOffTime insertOnTime

insertWidth padX padY

relief selectBackground

selectBorderWidth selectForeground

setGrid

13See the "options" manual entry for details on  the  standard  op‐
14tions.

activeRelief elementBorderWidth jumptroughColor

16See  the "scrollbar" widget manual entry for details on the above
17associated options.

spacing1 spacing2 spacing3 state

tabs wrap

20See the "text" widget manual entry for details on the above asso‐
21ciated options.

disabledForeground labelBitmap labelFontlabelImage

labelMargin labelPos labelText labelVariable

state sticky

25See the "labeledwidget" class manual entry for details on the in‐
26herited options.
27Name:           height
28Class:          Height
29Command‐Line Switch:           ‐height
30Specifies the height of the scrolled text as an entire unit.  The
31value  may be specified in any of the forms acceptable to Tk_Get‐

Pixels. Any additional space needed to display the other compo‐

33nents  such  as labels, margins, and scrollbars force the text to
34be compressed.  A value of zero along with the same value for the
35width  causes  the  value given for the visibleitems option to be
36applied which administers geometry  constraints  in  a  different
37manner.  The default height is zero.
38Name:           hscrollMode
39Class:          ScrollMode
40Command‐Line Switch:           ‐hscrollmode
41Specifies  the  the  display  mode  to be used for the horizontal
42scrollbar: static, dynamic, or none.  In static mode, the  scroll
43bar  is displayed at all times.  Dynamic mode displays the scroll
44bar as required, and none disables the scroll bar  display.   The
45default is static.
46Name:           sbWidth
47Class:          Width
48Command‐Line Switch:           ‐sbwidth
49Specifies  the width of the scrollbar in any of the forms accept‐
50able to Tk_GetPixels.
51Name:           scrollMargin
52Class:          Margin
53Command‐Line Switch:           ‐scrollmargin
54Specifies the distance between the text area and scrollbar in any
55of  the  forms acceptable to Tk_GetPixels.  The default is 3 pix‐
56els.
57Name:           textBackground
58Class:          Background
59Command‐Line Switch:           ‐textbackground
60Specifies the background color for the text area in  any  of  the
61forms acceptable to Tk_GetColor.
62Name:           textFont
63Class:          Font
64Command‐Line Switch:           ‐textfont
65Specifies the font to be used in the scrolled text area.
66Name:           visibleitems
67Class:          VisibleItems
68Command‐Line Switch:           ‐visibleitems
69Specifies  the widthxheight in characters and lines for the text.
70This option is only administered if the width and height  options
71are  both  set  to zero, otherwise they take precedence.  The de‐
72fault value is 80x24.  With the visibleitems option engaged,  ge‐
73ometry  constraints are maintained only on the text.  The size of
74the other components such as labels, margins,  and  scroll  bars,
75are  additive  and independent, effecting the overall size of the
76scrolled text.  In contrast, should the width and height  options
77have  non zero values, they are applied to the scrolled text as a
78whole.  The text is compressed or expanded to maintain the geome‐
79try constraints.
80Name:           vscrollMode
81Class:          ScrollMode
82Command‐Line Switch:           ‐vscrollmode
83Specifies  the  the  display  mode  to  be  used for the vertical
84scrollbar: static, dynamic, or none.  In static mode, the  scroll
85bar  is displayed at all times.  Dynamic mode displays the scroll
86bar as required, and none disables the scroll bar  display.   The
87default is static.
88Name:           width
89Class:          Width
90Command‐Line Switch:           ‐width
91Specifies  the width of the scrolled text as an entire unit.  The
92value may be specified in any of the forms acceptable to  Tk_Get‐

Pixels. Any additional space needed to display the other compo‐

94nents such as labels, margins, and scrollbars force the  text  to
95be compressed.  A value of zero along with the same value for the
96height causes the value given for the visibleitems option  to  be
97applied  which  administers  geometry  constraints in a different
98manner.  The default width is zero.
99
100The iwidgets::scrolledtext command creates a scrolled text widget
101with  additional options to manage the scrollbars.  This includes
102options to control the method in which the  scrollbars  are  dis‐
103played,  i.e. statically or  dynamically.  Options also exist for
104adding a label to the scrolled text area and controlling its  po‐
105sition.  Import/export of methods are provided for file I/O.
106
107The  iwidgets::scrolledtext  command  creates  a  new Tcl command
108whose name is pathName.  This command may be used to invoke vari‐
109ous operations on the widget.  It has the following general form:

pathName option ?arg arg ...? Option and the args determine the

111exact behavior of the command.  The following commands are possi‐
112ble for scrolledtext widgets:

bbox compare debug delete

dlineinfo get image index

see tag window xview

yview

118See the "text" manual entry for details on the standard methods.
119

pathName cget option Returns the current value of the configura‐

121tion  option  given by option.  Option may have any of the values
122accepted by the iwidgets::scrolledtext command.  pathName  child‐

site Returns the child site widget path name. pathName clear

124Clear the text area of all characters.  pathName  configure  ?op‐

tion? ?value option value ...? Query or modify the configuration

126options of the widget.  If no option is specified, returns a list
127describing all of the available options for pathName (see Tk_Con‐

figureInfo for information on the format of this list). If op‐

tion is specified with no value, then the command returns a list

130describing the one named option (this list will be  identical  to
131the  corresponding  sublist of the value returned if no option is
132specified).  If one or more  option−value  pairs  are  specified,
133then  the command modifies the given widget option(s) to have the
134given value(s);  in  this  case  the  command  returns  an  empty
135string.   Option may have any of the values accepted by the iwid‐

gets::scrolledtext command. pathName import filename ?index?

137Load  the  text from a file into the text area at the index.  The

filename must exist. pathName export filename Write text to a

139file.   If  filename  exists then contents are replaced with text
140widget contents.
141
142Name:           text
143Class:          Text
144The text component is the text widget.   See  the  "text"  widget
145manual entry for details on the text component item.
146Name:           horizsb
147Class:          Scrollbar
148The  horizsb  component  is  the  horizontal scroll bar.  See the
149"scrollbar" widget manual entry for details on the horizsb compo‐
150nent item.
151Name:           vertsb
152Class:          Scrollbar
153The  vertsb  component  is  the  vertical  scroll  bar.   See the
154"scrollbar" widget manual entry for details on the vertsb  compo‐
155nent item.
156
157 package require Iwidgets 4.0
158 option add *textBackground white
159
160 iwidgets::scrolledtext   .st   ‐hscrollmode  dynamic  ‐labeltext
161"Password File"
162
163 pack .st ‐padx 10 ‐pady 10 ‐fill both ‐expand yes
164
165 .st import /etc/passwd Mark L. Ulferts scrolledtext, text,  wid‐
166get
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
Impressum