iwidgets::scrolledcanvas(1)
β¨ NAME β¨
iwidgets::scrolledcanvas β bestie, it creates scrolled canvas widgets and manipulates them π
This is the iwidgets::scrolledcanvas(1) page, coming at you straight from [incr Widgets] π«Ά
π¦ SYNOPSIS π¦
iwidgets::scrolledcanvas pathName ?options?
π INHERITANCE π
The family tree goes like this, and yes it's giving royal lineage:
itk::Widget <- iwidgets::Labeledwidget <- iwidgets::Scrolledwidget <- iwidgets::Scrolledcanvas
πΈ STANDARD OPTIONS πΈ
These are the classics, the ones everybody gets:
activeBackground,background,borderWidth,cursorexportSelection,font,foreground,highlightColorhighlightThickness,insertBorderWidth,insertOffTime,insertOnTimeinsertWidth,relief,selectBackground,selectBorderWidthselectForeground
See the options manual entry for the details on the standard options, okurrr π
π ASSOCIATED OPTIONS π
Canvas-flavoured ones:
closeEnough,confine,scrollRegion,xScrollIncrement,yScrollIncrement
See the canvas widget manual entry for details on the above associated options.
Scrollbar-flavoured ones:
activeRelief,elementBorderWidth,jumptroughColor
See the scrollbar widget manual entry for details on the above associated options.
π INHERITED OPTIONS π
disabledForeground,labelBitmap,labelFontlabelImage,labelMargin,labelPos,labelText,labelVariable,state,sticky
(yeah those two came squished together in the original, i'm not touching it π)
See the labeledwidget class manual entry for details on the inherited options.
π WIDGET-SPECIFIC OPTIONS π
- Name:
autoMarginβ Class:AutoMarginβ Command-Line Switch:-automargin
Specifies the autoresize extra margin to reserve. This option is only effective with autoresize turned on. The default is 10.
- Name:
autoResizeβ Class:AutoResizeβ Command-Line Switch:-autoresize
Automatically adjusts the scrolled region to be the bounding box covering all the items in the canvas following the execution of any method which creates or destroys items. Thus, as new items are added, the scrollbars adjust accordingly. Obsessed with the self-awareness, honestly π₯
- Name:
heightβ Class:Heightβ Command-Line Switch:-height
Specifies the height of the scrolled canvas widget in any of the forms acceptable to Tk_GetPixels. The default height is 30 pixels.
- Name:
hscrollModeβ Class:ScrollModeβ Command-Line Switch:-hscrollmode
Specifies the 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. The default is static.
- Name:
sbWidthβ Class:Widthβ Command-Line Switch:-sbwidth
Specifies the width of the scrollbar in any of the forms acceptable to Tk_GetPixels. The default width is 15 pixels..
- Name:
scrollMarginβ Class:ScrollMarginβ Command-Line Switch:-scrollmargin
Specifies the distance between the canvas and scrollbar in any of the forms acceptable to Tk_GetPixels. The default is 3 pixels.
- Name:
textBackgroundβ Class:Backgroundβ Command-Line Switch:-textbackground
Specifies the background color for the canvas. This allows the background within the canvas to be different from the normal background color. Iconic, honestly π
- Name:
vscrollModeβ Class:ScrollModeβ Command-Line Switch:-vscrollmode
Specifies the 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. The default is static.
- Name:
widthβ Class:Widthβ Command-Line Switch:-width
Specifies the width of the scrolled canvas widget in any of the forms acceptable to Tk_GetPixels. The default height is 30 pixels. (yes it says height, i'm just the messenger π)
β DESCRIPTION β
The iwidgets::scrolledcanvas command creates a scrolled canvas with additional options to manage horizontal and vertical scrollbars. This includes options to control which scrollbars are displayed and the method, i.e. statically or dynamically. So you get the canvas and the scrollbar drama handled for you π«Ά
π§ METHODS π§
The iwidgets::scrolledcanvas 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 scrolledcanvas widgets:
π ASSOCIATED METHODS π
addtag,bbox,bind,canvasxcanvasy,coords,create,dcharsdelete,dtag,find,focusgettags,icursor,index,insertitemconfigure,lower,move,postscriptraise,scale,scan,selecttype,xview,yview
See the canvas manual entry for details on the associated 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::scrolledcanvas command.
pathName childsite
Returns the child site widget path name.
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::scrolledcanvas command.
pathName justify direction
Justifies the canvas contents via the scroll bars in one of four directions: left, right, top, or bottom.
π COMPONENTS π
- Name:
canvasβ Class:Canvas
The canvas component is the canvas widget. See the canvas widget manual entry for details on the canvas component item.
- 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.
- 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 π₯
Steal this, it's cute:
package require Iwidgets 4.0
iwidgets::scrolledcanvas .sc
.sc create rectangle 100 100 400 400 -fill red
.sc create rectangle 300 300 600 600 -fill green
.sc create rectangle 200 200 500 500 -fill blue
pack .sc -padx 10 -pady 10 -fill both -expand yes
π«Ά AUTHOR π«Ά
Mark L. Ulferts
π KEYWORDS π
scrolledcanvas, canvas, widget
That's the whole page bestie, no cap, nothing skipped π go forth and scroll.
β¨ signing off β this one's a Tk situation, iwidgets::scrolledcanvas(1), mwah π
π¦ 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