Chapter 37. The Radiobutton Widget

Table of Contents
When to use the Radiobutton Widget
Patterns
Methods
Options

The Radiobutton is a standard Tkinter widget used to implement one-of-many selections. Radiobuttons can contain text or images, and you can associate a Python function or method with each button. When the button is pressed, Tkinter automatically calls that function or method.

The button can only display text in a single font, but the text may span more than one line. In addition, one of the characters can be underlined, for example to mark a keyboard shortcut. By default, the Tab key can be used to move to a button widget.

Each group of Radiobutton widgets should be associated with single variable. Each button then represents a single value for that variable.

When to use the Radiobutton Widget

The radiobutton widget is used to implement one-of-many selections. It's almost always used in groups, where all group members use the same variable.