This is an unofficial mirror of Tkinter reference documentation (based on Python 2.7 and Tk 8.5) created by the late John Shipman.
It was last updated in 2013 and is unmaintained. [More info]
When the user manipulates a scrollbar, the scrollbar
calls its command
callback. The arguments
to this call depend on what the user does:
When the user requests a movement of one “unit” left or up, for example by clicking button B1 on the left or top arrowhead, the arguments to the callback look like:
command
(tk.SCROLL, -1, tk.UNITS)
When the user requests a movement of one unit right or down, the arguments are:
command
(tk.SCROLL, 1, tk.UNITS)
When the user requests a movement of one page left or up:
command
(tk.SCROLL, -1, tk.PAGES)
When the user requests a movement of one page right or down:
command
(tk.SCROLL, 1, tk.PAGES)
When the user drags the slider to a value
in the range
[0,1], where 0 means all the way left or up and 1
means all the way right or down, the call is:
f
command
(tk.MOVETO,f
)
These calling sequences match the arguments expected by
the .xview()
and .yview()
methods of canvases, listboxes, and text widgets. The
Entry
widget does not have an .xview()
method. See Section 10.1, “Scrolling an Entry
widget”.