Chapter 4. Checkbuttons and Radiobuttons

This chapter discusses both checkbutton and radiobutton widgets. Although they are very similar, they are used for different purposes.

Checkbuttons are useful when you want to select as many items as you want, such as a shopping list. Radiobuttons are used in group situations when you must make a choice between items, such as on a multiple-choice exam:

Q1: What year did Columbus discover America?
A) 1400
B) 1470
C) 1472
D) 1492
E) none of the above

Because radiobuttons are grouped together, you are forced to select one and only one choice in that group. If the default choice is always A and you click on D, A would be automatically unclicked (or unselected).

The two sections in this chapter cover how to use both widget types and ways to set them up and configure them.

Get Learning Perl/Tk 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.