Introduction to the Tkinter Separator widget A separator widget places a thin horizontal or vertical rule between groups of widgets. To create a separator widget, you use the ttk.Separator constructor like this: sep = ttk.Separator(container,orient=’horizontal’)Code language: JavaScript (javascript) The orient option can be either ‘horizontal’ or ‘vertical’. The following example illustrates how to use a separator widget toContinue Reading

Introduction to the Tkinter ScrolledText widget So far, you’ve learned how to create a Text widget and how to link a vertical Scrollbar to the text widget. To make it more convenient, Tkinter provides you with the ScrolledText widget which does the same things as a text widget linked to a vertical scroll bar. To useContinue Reading

Introduction to the Tkinter scrollbar widget A scrollbar allows you to view all parts of another widget whose content is typically larger than the available space. Tkinter scrollbar widget is not a part of any other widgets such as Text and Listbox. Instead, a scrollbar is an independent widget. To use the scrollbarContinue Reading

Introduction to Tkinter Text widget The Text widget allows you to display and edit multi-line textarea with various styles. Besides the plain text, the Text widget supports embedded images and links. To create a text widget, you use the following syntax: In this syntax: Note that the Text widget is only available in the Tkinter module,Continue Reading

Introduction to Tkinter Frame A frame is a widget that displays as a simple rectangle. Typically, you use a frame to organize other widgets both visually and at the coding level. To create a frame, you use the ttk.Frame class: frame = ttk.Frame(container, **options)Code language: Python (python) A frame has various configuration objects whichContinue Reading

Introduction to Tkinter place geometry manager The Tkinter place geometry manager allows you to precisely position widgets within its container using the (x, y) coordinate system. To access the place geometry manager, you use the place() method on all the standard widgets like this: widget.place(**options)Code language: CSS (css) Absolute and relative positions The place geometry manager provides youContinue Reading

Introduction to the Tkinter grid geometry manager The grid geometry manager uses the concepts of rows and columns to arrange the widgets. The following shows a grid that consists of four rows and three columns: Each row and column in the grid is identified by an index. By default, the firstContinue Reading

Introduction to the Tkinter pack geometry manager So far, you have learned how to use the pack() method to add widgets to a window. Tkinter uses the geometry manager to arrange widgets on a window. The pack() method is one of three geometry managers in Tkinter. The other geometry managers are grid() and place(). The pack arrangesContinue Reading

Introduction to Tkinter Entry widget The Entry widget allows you to enter a sing-line text. In Tkinter, to create a textbox, you use the Entry widget: textbox = ttk.Entry(container, **options)Code language: Python (python) In this syntax: Note that if you want to enter multi-line text, you should use the Text widget. To get the current textContinue Reading

Introduction to Tkinter button widget Button widgets represent a clickable item in the applications. Typically, you use a text or an image to display the action that will be performed when clicked. Buttons can display text in a single font. However, the text can span multiple lines. On top ofContinue Reading