The scrolledcanvas iwidget applies scrollbars and display options to a standard Tk canvas widget. All the standard canvas commands and options have been maintained. A new option, autoresize, has been added which allows the user to engage automatic resizing of the scroll region to be the bounding box covering all the items. The region is adjusted continuously as items are created and destroyed via the canvas commands, effecting the display of the scrollbars.
For further information, see the Scrolledcanvas
Components: canvas clipper horizsb hull label vertsb
wm title . "Scrolledcanvas Example"
## Create scrolledcanvas iwidget
iwidgets::scrolledcanvas .sc \
-textbackground gray \
-width 300 \
-height 300 \
-vscrollmode dynamic \
-hscrollmode dynamic \
-labeltext "Scrolledcanvas Example"
.sc create rectangle 100 100 200 200 -fill red
.sc create rectangle 300 300 400 400 -fill green
.sc create rectangle 200 200 300 300 -fill blue
pack .sc \
-padx 10 \
|Download this sample code