5.3. The Perl/Tk LabEntry Mega-WidgetPerl/Tk provides special code that combines a Label with an arbitrary widget, so you can have LabArbitrary widgets. This is fully explained in Chapter 14, "Creating Custom Widgets in Pure Perl/Tk". Perhaps the most common of these labeled widgets is LabEntry. It's configured using standard options, and ordinary options such as -font are directed to the Entry subwidget. To configure the Label subwidget, use options such as -labelFont, -labelBackground, and so on. There's a special option, -labelPack, that accepts a reference to a list of packer options and controls the relative geometry of the Label and Entry subwidgets. By default, the Label is packed on top of the Entry. If you prefer left-side packing, use -labelPack as in the example below. This example shows how to use a fixed-width font to create a column of aligned LabEntry widgets:
Please refer to Chapter 14, "Creating Custom Widgets in Pure Perl/Tk" for a complete list of -label options.
Copyright © 2002 O'Reilly & Associates. All rights reserved. |
|