tkinter Scrolling widgets

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Introduction

Scrollbars can be added to Listbox, Canvas, and Text widgets. In addition, Entry widgets can be scrolled horizontally. To be able to scroll other type of widgets, you need to put them inside a Canvas or a Text widget.

Syntax

  • scrollbar = tk.Scrollbar(parent, **kwargs)

Parameters

ParameterDescription
parenttkinter widgets exist in a hierarchy. Except for the root window, all widgets have a parent. Some online tutorials call this "master". When the widget is added to the screen with pack, place or grid, it will appear inside this parent widget
orientOrientation of the scrollbar, either "vertical" (default value) or "horizontal"

Remarks

These examples assume that tkinter has been imported with either import tkinter as tk (python 3) or import Tkinter as tk (python 2).



Got any tkinter Question?