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