Previous section   Next section

Practical Programming in Tcl & Tk, Third Edition
By Brent B. Welch

Table of Contents
Part IV.  Tk Widgets

Chapter 30. Scrollbars

This chapter describes the Tk scrollbar. Scrollbars have a general protocol that is used to attach them to one or more other widgets.

Scrollbars control other widgets through a standard protocol based around Tcl commands. A scrollbar uses a Tcl command to ask a widget to display part of its contents. The scrollable widget uses a Tcl command to tell the scrollbar what part of its contents are visible. The Tk widgets designed to work with scrollbars are: entry, listbox, text, and canvas. The scrollbar protocol is general enough to use with new widgets, or collections of widgets. This chapter explains the protocol between scrollbars and the widgets they control, but you don't need to know the details to use a scrollbar. All you need to know is how to set things up, and then these widgets take care of themselves.

      Previous section   Next section