The Scrollbar Protocol

When the user manipulates the scrollbar, it calls its registered command with some additional parameters that indicate what the user said to do. The associated widget responds to this command (e.g., its xview operation) by changing its display. After the widget changes its display, it calls the scrollbar by using its registered xscrollcommand or yscrollcommand (e.g., the set operation) with some parameters that indicate the new relative size and position of the display. The scrollbar updates its appearance to reflect this information.

The protocol supports widgets that change their display by themselves, such as when more information is added to the widget. Scrollable widgets also support a binding to <B2-Motion> (i.e., ...

Get Practical Programming in Tcl & Tk, Third Edition 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.