From the course: Python GUI Development with Tkinter
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Attaching a scroll bar to widgets
From the course: Python GUI Development with Tkinter
Attaching a scroll bar to widgets
- [Instructor] If your GUI includes widgets which are too large to view in the available space, then you can include a scroll bar to enable the user to selectively view different sections of it. The scroll bar is commonly used to navigate a lengthy text widget or a large canvas. Scroll bars are their own unique widgets in Tk, rather than just being a sub feature of other widgets. The scroll bar widget interfaces back and forth with other widgets that support scrolling through a set of methods. The scroll bar lets the widget being scrolled know its current position, and the widget that's being scrolled lets the scroll bar know what percentage of the entire area is currently visible. For this example, I've already imported the Tkinter package and Ttk module, as well as created my root top level window. I've also gone ahead and created a new text widget, which is a size of 40 in width, 10 lines in height, with the word wrap property, and I've placed it in that main top level window using…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
(Locked)
Entering and displaying multiple lines with the Text widget11m 31s
-
(Locked)
Adding tags, marks, images, and widgets to the Text widget9m 57s
-
(Locked)
Building a hierarchical treeview7m 19s
-
(Locked)
Adding columns and selecting items in the Treeview7m 12s
-
(Locked)
Building cascading menus11m 5s
-
(Locked)
Drawing a basic line on the Canvas5m 21s
-
(Locked)
Drawing complex shapes on the Canvas9m 58s
-
(Locked)
Attaching a scroll bar to widgets6m 21s
-
(Locked)
Configuring widget styles9m 49s
-
(Locked)
Prompting users with the Messagebox and dialogs6m 11s
-
(Locked)
-
-
-
-