The radiobutton lets you select from a variety of items. They are part of the default tk module. Unlike a checkbox, a tkinter lets you select only one option.
You can achive that by adding the same variable as parameter for the radiobuttons. If a radiobutton is clicked you can call a callback function.
Related course: Python Desktop Apps with Tkinter
radiobutton
tkinter radiobutton
The program below creates 3 radiobuttons with the method Radiobutton. It adds a window as parameter, the text, the variable to connect it with and a callback function.
For it to work, all radiobuttons need to be linked to the same variable, in this example var.
1 | #!/usr/bin/env python |