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

Attaching a scroll bar to widgets

From the course: Python GUI Development with Tkinter

Start my 1-month free trial

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…

Contents