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 15. Composite Widgets

So far, we have only discussed each basic widget separately. The Perl/Tk distribution also includes several composite widgets. Composite widgets are combinations of widgets that do something specific when they are combined. Here are some examples of composite widgets:

Optionmenu

Based on menubutton widget; it allows the user to select from a list of items on the menu.

LabEntry

Based on frame widget; it is an entry widget with a configurable label.

Dialog

Based on toplevel widget; it displays a bitmap and a message to the user.

I chose these examples because they demonstrate a good point about composite widgets. They can be based on a widget (in this case, menubutton), on a frame that contains widgets, or on a toplevel widget that contains other widgets and is a complete window.

When I first started learning about composite widgets, I always felt like I was missing something. If I looked at the code out of the corner of my eye, it made sense. Yet if I looked at it head on, I was suddenly utterly confused and wasn't sure what it was doing. The important thing to remember is that there is quite a bit that goes on behind the scenes that we take advantage of when we are creating a composite widget.

My goal with this chapter isn't for you to write the most complex type of composite widget you can think of. Simply understanding how composite widgets work is more than enough. You can build up slowly from there. The best thing to do is read through this ...

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