Parameter | Description |
---|---|
parent | tkinter 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. |
command | function called each time the user changes the state of the radiobutton |
indicatoron | 1 or True for radio buttons, 0 or False for button boxes |
text | Text to display next to the radiobutton. |
value | When the radiobutton is selected, the associated control variable is set to value. |
variable | Control variable the radiobutton shares with the other radiobutton of the group. |
These examples assume that tkinter has been imported with either import tkinter as tk
(python 3) or import Tkinter as tk
(python 2).
Reference:
To turn the above example into a “button box” rather than a set of radio buttons, set the indicatoron option to 0. In this case, there’s no separate radio button indicator, and the selected button is drawn as SUNKEN instead of RAISED: