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

Chapter 7. The Listbox Widget

A listbox widget is designed to list strings of text, one text string per line. You can then select a line or multiple lines from the listbox to perform other operations on. Some examples of things to place inside a listbox:

  • An alphabetized list of cities.

  • A list of servers to log in to. Select a server name and then enter a name and password into some entry widgets. Click the OK button to log in.

  • A list of operating systems.

  • A list of payment options: MasterCard, American Express, Visa, Check, Cash.

A listbox is ideal for replacing radiobuttons or checkboxes that have become too numerous to display on the screen. Usually 3 or 4 checkbuttons or radiobuttons aren't a big deal, but if you had to try to display 10 at a time, the window could get a little crowded. A group of radiobuttons can be replaced by a listbox that limits the number of selections to one and has a default selection. A bunch of checkbuttons can be replaced by a listbox that allows multiple selections.

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