Skip to Main Content
Learning Perl/Tk
book

Learning Perl/Tk

by Nancy Walsh
January 1999
Beginner content levelBeginner
373 pages
9h 43m
English
O'Reilly Media, Inc.
Content preview from Learning Perl/Tk

4.1. The Checkbutton Widget

In Chapter 3, you learned the options associated with the button widget. A checkbutton is also considered a type of button (and it uses many of the same options), even though the way it is used in an application is different from the way a standard button is used.

Instead of clicking on a checkbutton and expecting something to happen immediately, you use it to indicate a yes or no answer. If the checkbutton is checked it means yes; unchecked means no. You might use a checkbutton to list options for printing a document. The text on the checkbuttons might say Print Header Page, Even Pages Only, Odd Pages Only, and Number Pages. At the bottom of the window there would be a Print button, and when you clicked on it, the program would find out which checkbuttons were selected and submit the print job accordingly.

A window listing several jobs to run (like a batch job controller) might use checkbuttons to ask the user if each job should be run. If the checkbutton next to the job name is selected, the job will be run. If the checkbutton is unselected, then the job will be skipped this time around.

Each time a checkbutton is used, the application is asking the user to answer a yes or no question. Checkbuttons that make up a group are typically related (as in our print job example), but they don't have to be because the answer to each checkbutton is independent ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Perl/Tk

Mastering Perl/Tk

Stephen Lidie, Nancy Walsh

Publisher Resources

ISBN: 1565923146Supplemental ContentCatalog PageErrata