Version 7 of ttk::scrollbar

Updated 2019-04-29 16:17:25 by oehhar

A Ttk (i.e. theme-able) scrollbar widget.

ttk::scrollbar pathName ?options…?
http://www.tcl.tk/man/tcl/TkCmd/ttk_scrollbar.htm

Layout names

HaO 2019-04-29: The layouts are called: Horizontal.TScrollbar and Vertical.TScrollbar:

% ttk::style layout Vertical.TScrollbar
Vertical.Scrollbar.trough -sticky ns -children {
    Vertical.Scrollbar.uparrow -side top -sticky {}
    Vertical.Scrollbar.downarrow -side bottom -sticky {}
    Vertical.Scrollbar.thumb -sticky nswe -unit 1 -children {
        Vertical.Scrollbar.grip -sticky {}}}

A custom stlye may be defined as follows:

ttk::style configure My.Vertical.TScrollbar -troughcolor yellow
pack [ttk::scrollbar .s -style My.Vertical.TScrollbar -orient vertical -command ".t yview"] -fill y -expand true -side right
pack [text .t -yscrollcommand ".s set"] -side left -fill both -expand true
.t insert 1.0 [string repeat 1\n 100]

The following styling options are supported: The description is for a vertical slider. There are 5 regions named here: upper arrow, upper trough, thumb, lower trough, lower arrow.

-orient?
-background?
-bordercolor?
-troughcolortrough color
-lightcolor?
-darkcolorcolor of the frames of each element
-arrowcolorarrow background color
-arrowsizearrows width and height and thus width of the widget
-gripcountnumber of vertical lines on the thumb
-sliderlengthHeight of the thumb