|
Scrolledwidget
Implements a general purpose base class for scrolled widgets, by creating the necessary horizontal and vertical scrollbars and providing protected methods for controlling their display. The derived class needs to take advantage of the fact that the grid is used and the vertical scrollbar is in row 0, column 2 and the horizontal scrollbar in row 2, column 0.
For further information, see the Scrolledwidget
manpage
Components: horizsb hull label vertsb
|
wm title . "Scrolledwidget Example"
##=========================================================
## Create a Scrolledwidget Example"
##=========================================================
##
iwidgets::scrolledwidget .sw \
-width 200 \
-height 200 \
-hscrollmode static \
-vscrollmode static
grid .sw
set cs [.sw childsite]
set cs .sw
frame $cs.fm \
-relief groove \
-bd 4
grid $cs.fm \
-row 0 \
-column 0
text $cs.fm.text \
-setgrid 1
pack $cs.fm.text \
-expand true \
-fill both
grid columnconfigure $cs.fm 0 -weight 1
grid rowconfigure $cs.fm 0 -weight 1
|
Download this sample code |
|