Checkbox widgets are something so obvious you never think about them. They're like on/off switches and you can have multiple of them. It is one of the widgets included in tkinter.
If you want zero or more options to be clickable, you can use a checkbox. Otherwise you'd use a radiobutton or another type of button.
Related course: Python Desktop Apps with Tkinter
checkbox
tkinter checkbox
The tkinter checkbox widget is a very basic switch. A checkbox in tkinter is named a CheckButton. You can add two checkboxes like this:
1 |
c1 = tk.Checkbutton(window, text='Python',variable=var1, onvalue=1, offvalue=0, command=print_selection) |
demo
The program below adds several checkbuttons to the window. If you click on the checkbox the text above changes.
1 |
#!/usr/bin/env python |