iwidgets::scrolledtext(1)
β¨ NAME β¨
iwidgets::scrolledtext β creates and manipulates a scrolled text widget. That's it, that's the whole serve. π
π SYNOPSIS π
iwidgets::scrolledtext pathName ?options?
π¦ INHERITANCE π¦
Okay so the family tree? Immaculate lineage, no notes:
itk::Widget <- iwidgets::Labeledwidget <- iwidgets::Scrolledwidget <- iwidgets::Scrolledtext
β STANDARD OPTIONS β
These are the classics, the icons, the ones everyone already knows:
activeBackgroundbackgroundborderWidthcursorexportSelectionforegroundhighlightColorhighlightThicknessinsertBackgroundinsertBorderWidthinsertOffTimeinsertOnTimeinsertWidthpadXpadYreliefselectBackgroundselectBorderWidthselectForegroundsetGrid
See the options manual entry for details on the standard options, bestie. It's all there. π«Ά
π ASSOCIATED OPTIONS π
Scrollbar-flavored first:
activeReliefelementBorderWidthjumptroughColor
See the scrollbar widget manual entry for details on the above associated options.
Then the text-widget girlies:
spacing1spacing2spacing3statetabswrap
See the text widget manual entry for details on the above associated options.
π INHERITED OPTIONS π
Handed down from the ancestors, and honestly they ate:
disabledForegroundlabelBitmaplabelFontlabelImagelabelMarginlabelPoslabelTextlabelVariablestatesticky
See the labeledwidget class manual entry for details on the inherited options.
π WIDGET-SPECIFIC OPTIONS π
This is where it gets personal. Main character energy only.
-height
- Name:
height - Class:
Height - Command-Line Switch:
-height
Specifies the height of the scrolled text as an entire unit, not just the texty part. The value may be specified in any of the forms acceptable to Tk_GetPixels. Any extra space needed to display the other components β labels, margins, scrollbars, the whole entourage β forces the text to be compressed. A value of zero, together with the same value for the width option, causes the value given for the visibleitems option to be applied, which administers geometry constraints in a different manner. The default height is zero.
-hscrollmode
- Name:
hscrollMode - Class:
ScrollMode - Command-Line Switch:
-hscrollmode
Specifies the display mode to be used for the horizontal scrollbar: static, dynamic, or none. In static mode, the scroll bar is displayed at all times. dynamic mode displays the scroll bar as required, and none disables the scroll bar display entirely. The default is static.
-sbwidth
- Name:
sbWidth - Class:
Width - Command-Line Switch:
-sbwidth
Specifies the width of the scrollbar, in any of the forms acceptable to Tk_GetPixels.
-scrollmargin
- Name:
scrollMargin - Class:
Margin - Command-Line Switch:
-scrollmargin
Specifies the distance between the text area and the scrollbar, in any of the forms acceptable to Tk_GetPixels. The default is 3 pixels.
-textbackground
- Name:
textBackground - Class:
Background - Command-Line Switch:
-textbackground
Specifies the background color for the text area, in any of the forms acceptable to Tk_GetColor.
-textfont
- Name:
textFont - Class:
Font - Command-Line Switch:
-textfont
Specifies the font to be used in the scrolled text area.
-visibleitems
- Name:
visibleitems - Class:
VisibleItems - Command-Line Switch:
-visibleitems
Specifies the widthx*height* in characters and lines for the text. Heads up: this option is only administered if the width and height options are both set to zero β otherwise they take precedence, periodt. The default value is 80x24. With the visibleitems option engaged, geometry constraints are maintained only on the text. The size of the other components β labels, margins, scroll bars β is additive and independent, affecting the overall size of the scrolled text. In contrast, should the width and height options have non-zero values, they are applied to the scrolled text as a whole, and the text is compressed or expanded to maintain the geometry constraints. β¨
-vscrollmode
- Name:
vscrollMode - Class:
ScrollMode - Command-Line Switch:
-vscrollmode
Specifies the display mode to be used for the vertical scrollbar: static, dynamic, or none. In static mode, the scroll bar is displayed at all times. dynamic mode displays the scroll bar as required, and none disables the scroll bar display entirely. The default is static.
-width
- Name:
width - Class:
Width - Command-Line Switch:
-width
Specifies the width of the scrolled text as an entire unit. The value may be specified in any of the forms acceptable to Tk_GetPixels. Any extra space needed to display the other components β labels, margins, scrollbars β forces the text to be compressed. A value of zero, together with the same value for the height option, causes the value given for the visibleitems option to be applied, which administers geometry constraints in a different manner. The default width is zero.
π DESCRIPTION π
The iwidgets::scrolledtext command creates a scrolled text widget with extra options to manage the scrollbars. This includes options to control the method in which the scrollbars are displayed β i.e. statically or dynamically. Options also exist for adding a label to the scrolled text area and controlling its position. Import/export of methods are provided for file I/O. Slay. π
π METHODS π
The iwidgets::scrolledtext command creates a new Tcl command whose name is pathName. This command may be used to invoke various operations on the widget. It has the following general form:
pathName option ?arg arg ...?
option and the args determine the exact behavior of the command. The following commands are possible for scrolledtext widgets:
π₯ ASSOCIATED METHODS π₯
bboxcomparedebugdeletedlineinfogetimageindexinsertmarkscansearchseetagwindowxviewyview
See the text manual entry for details on the standard methods.
πΈ WIDGET-SPECIFIC METHODS πΈ
pathName cget option
Returns the current value of the configuration option given by option. option may have any of the values accepted by the iwidgets::scrolledtext command.
pathName childsite
Returns the child site widget path name.
pathName clear
Clear the text area of all characters. Blank slate, fresh start, iconic. β¨
pathName configure ?option? ?value option value ...?
Query or modify the configuration options of the widget. If no option is specified, returns a list describing all of the available options for pathName (see Tk_ConfigureInfo for information on the format of this list). If option is specified with no value, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no option is specified). If one or more option-value pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. option may have any of the values accepted by the iwidgets::scrolledtext command.
pathName import filename ?index?
Load the text from a file into the text area at the index. The filename must exist. No cap.
pathName export filename
Write text to a file. If filename exists then contents are replaced with text widget contents.
π§ COMPONENTS π§
text
- Name:
text - Class:
Text
The text component is the text widget. See the text widget manual entry for details on the text component item.
horizsb
- Name:
horizsb - Class:
Scrollbar
The horizsb component is the horizontal scroll bar. See the scrollbar widget manual entry for details on the horizsb component item.
vertsb
- Name:
vertsb - Class:
Scrollbar
The vertsb component is the vertical scroll bar. See the scrollbar widget manual entry for details on the vertsb component item.
π EXAMPLE π
Copy this, run this, thank me later:
package require Iwidgets 4.0
option add *textBackground white
iwidgets::scrolledtext .st -hscrollmode dynamic -labeltext "Password
File"
pack .st -padx 10 -pady 10 -fill both -expand yes
.st import /etc/passwd
π AUTHOR π
Mark L. Ulferts
π KEYWORDS π
scrolledtext, text, widget
Okay bestie, that's the whole page. This one lives in the Tk collection as iwidgets::scrolledtext(1), and now you know it front to back. Go build something cute. π¦π
β¨
π¦ where this page comes from
- debian bookworm: iwidgets4-doc 4.1.1-2.1
- debian trixie: iwidgets4-doc 4.1.1-4
- ubuntu jammy: iwidgets4-doc 4.1.1-2.1
- ubuntu noble: iwidgets4-doc 4.1.1-2.1
- ubuntu resolute: iwidgets4-doc 4.1.1-4
- ubuntu stonking: iwidgets4-doc 4.1.1-4
- Copyright (c) 1995 DSC Technologies Corporation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms