Name

scrollbar

scrollbar pathName [option value...]

The scrollbar command creates a new scrollbar widget named pathName.

Standard Options

-activebackground

-background

-borderwidth

-cursor

-highlightbackground

-highlightcolor

-highlightthickness

-jump

-orient

-relief

-repeatdelay

-repeatinterval

-takefocus

-troughcolor

 

Widget-Specific Options

-activerelief relief (activeRelief, ActiveRelief)

Relief type to use when scrollbar is active.

-command string (command, Command)

Prefix of Tcl command to invoke to change view in widget associated with the scrollbar. See "Scrolling Methods,” later in this section.

-elementborderwidth width (elementBorderWidth, BorderWidth)

Width of borders drawn around internal elements of scrollbar.

-width width (width, Width)

Desired narr ow dimension, in screen units, for the scrollbar.

Scrollbarelements

arrow1

Top (or left) arrow

trough1

Region between slider and arrow1

slider

Rectangle indicating visible region

trough2

Region between slider and arrow2

arrow2

Bottom (or right) arrow

Methods

pathName activate [element]

Mark element indicated by element as active. If not given, Return name of current element, or an empty string if no element is active.

pathName delta deltaX deltaY

Return a real number indicating the change in the scrollbar setting that will result if the slider moves deltaX pixels to the right and deltaY pixels to the left. The arguments may be zero or negative.

pathName fraction x y

Return real number between 0 and 1 indicating the fractional position of coordinates x y (in pixels ...

Get Tcl/Tk in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.