Exploring Tkinter input widgets

Like all toolkits, Tkinter offers a variety of input widgets for different kinds of data. However, ttk offers additional widget types and enhances some (but not all!) of Tkinter's native widgets. The following table offers advice on which widgets are most appropriate for different kinds of data entry:

Widget
Description
Used for
ttk.Entry Basic text entry Single-line strings
ttk.Spinbox Text entry with increment/decrement arrows Numbers
Tkinter.Listbox Box with a list of choices Choice between several values
Tkinter.OptionMenu Drop-down list with choices Choice between several values
ttk.Combobox Drop-down list with optional text entry Choice between several values plus text entry
ttk.Checkbutton ...

Get Python GUI Programming with Tkinter now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.