Introduction to the Tkinter canvas widget The canvas widget is the most flexible widget in Tkinter. The Canvas widget allows you to build anything from custom widgets to complete user interfaces. The canvas widget is a blank area on which you can draw figures, create text, and place images. ToContinue Reading

Introduction to the Tkinter Treeview widget A Treeview widget allows you to display data in both tabular and hierarchical structures. To create a Treeview widget, you use the ttk.Treeview class: tree = ttk.Treeview(container, **options)Code language: Python (python) A Treeview widget holds a list of items. Each item has one or more columns.Continue Reading

Introduction to the Tkinter Notebook widget The Notebook widget allows you to select pages of contents by clicking on tabs: When you click one of these tabs, the Notebook widget will display a child pane associated with the selected tab. Typically, a child pane is a Frame widget. To create a Notebook widget, you use the ttk.Notebook class as follows:Continue Reading

Introduction to the Tkinter Progressbar widget A Progressbar widget allows you to give feedback to the user about the progress of a long-running task. To create a Progressbar widget, you use the ttk.Progressbar class: ttk.Progressbar(container, **options)Code language: Python (python) The following shows the typical parameters to create a Progressbar widget: ttk.Progressbar(container, orient,Continue Reading

Introduction to the Tkinter LabelFrame Tkinter LabelFrame widget is a container that contains other related widgets. For example, you can group Radiobutton widgets and place the group on a LabelFrame. To create a LabelFrame widget, you use the ttk.LabelFrame: lf = ttk.LabelFrame(container, **option)Code language: Python (python) In this syntax, you specify the parent component (container) ofContinue Reading

Introduction to the Tkinter Sizegrip widget The Sizegrip widget typically locates in the bottom right corner of the window. It allows you to resize the enter application window: To create a Sizegrip widget, you use the following syntax: ttk.Sizegrip(parent, **option)Code language: Python (python) To make sure the Sizegrip widget works properly, you need to make theContinue Reading

Introduction to the Tkinter Spinbox widget A Spinbox widget allows you to select a value from a set of values. The values can be a range of numbers. A Spinbox has an area for showing the current value and a pair of arrowheads. When you click the upward-pointing arrowhead, theContinue Reading

Introduction to Tkinter slider widget A slider allows you to enter a value by moving an indicator. A slider can be vertical or horizontal: To create a slider, you’ll use the ttk.Scale() constructor as follows: ttk.Scale(container,from_,to)Code language: Python (python) In this syntax, the container specifies the parent component of the slider. The from_ and to options specify theContinue Reading

Introduction to the Tkinter PanedWindow widget The PaneWindow widget divides the space of a frame or a window. A PaneWindow is like a Frame that acts as a container for holding child widgets Typically, a PanedWindow contains a vertical or horizontal stack of child widgets: A PanedWindow uses a bar to separate the child widgets. This bar is called a sash. A sash can have a handle whichContinue Reading

Introduction to the Tkinter Listbox A Listbox widget displays a list of single-line text items. A Listbox allows you to browse through the items and select one or multiple items at once. To create a Listbox, you use the tk.Listbox class like this: listbox = tk.Listbox(container, listvariable, height)Code language: Python (python) InContinue Reading