May 2018
Beginner to intermediate
452 pages
11h 26m
English
The ttk Treeview does not have a scrollbar by default; it can be scrolled, using the keyboard or mouse-wheel controls, but users would reasonably expect a scrollbar on a scrollable area to help them visualize the size of the list and their current position in it.
Fortunately, ttk provides us with a Scrollbar object that can be connected to our Treeview widget:
self.scrollbar = ttk.Scrollbar(self,
orient=tk.VERTICAL, command=self.treeview.yview)
Here, Scrollbar takes the following two important arguments:
In this case, we set the callback to the tree view's yview method, which ...