The scrolled
widget provides a container for another widget
which can be scrolled in both the x and y directions. The widget includes the
horizontal and vertical scrollbars and ensures that the scrollbars are
correctly alligned with the side of the widget to be scrolled.
scrolled
pathName ?options?
background
Background
-background
#ccc
relief
Relief
-relief
flat
Tk_GetRelief
(3).
borderWidth
BorderWidth
-borderwidth
0
scrollBackground
Background
-scrollbackground
#ccc
scrollForeground
Foreground
-scrollforeground
#ccc
scrollRelief
Relief
-scrollrelief
flat
Tk_GetRelief
(3).
scrollBorderWidth
BorderWidth
-scrollborderwidth
0
manageKeyboard
ManageKeyboard
-managekbd
1
1
(the default), the widget will handle
keyboard traversal between its scrollbars. If the widget to be scrolled
can be scrolled via the keyboard, this option should be set to
0
and the
padX
Pad
-padx
2
scrolled
widget with the same amount of horizontal padding.
padY
Pad
-padx
2
scrolled
widget with the same amount of vertical padding.
-xcommand
0
scrollbar
widget.
-ycommand
0
scrollbar
widget.
configure
?option value...?
xset
total width first last
yset
total width first last
xget
xset
widget command.
yget
yset
widget command.
manage
widget ?widget...?
unmanagemanage
widget ?widget...?
These widget commands have the same effect as those of the
tabgroup
widget.
The scrolled
widget is used instead of a tabgroup and two
scrollbars. In fact that's pretty much what it is, except that it has a
more Motif-like visual appearance. The widget to be scrolled should
be packed into the scrolled
widget with the same
-padx
and -pady
options as passed to the
scrolled
widget itself. For instance:
scrolled .s -padx 2 -pady 2 -xcommand {.l xview} -ycommand {.l yview} listbox .l -xscrollcommand {.s xset} -yscrollcommand {.s yset} pack .l -in .s -fill both -padx 2 -pady 2 -expand yes pack .s -fill both -expand yes