home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Book HomeMastering Perl/TkSearch this book

23.7. The LabFrame Widget

A LabFrame widget has all the features of a Frame and additionally provides a text label on the 'top', 'bottom', 'left', or 'right' of the Frame. The special placement option 'acrosstop' creates a grooved Frame around the central Frame and puts the label near the northwest corner such that it overlays the groove.

use Tk;
use Tk::LabFrame;
use strict;

my $mw = MainWindow->new(-title => 'LabFrame example')
my $lf = $mw->LabFrame(-label => "This is the label of a LabFrame",
     -labelside => 'acrosstop')->pack;
$lf->Text(qw/-width 40 -height 5/)->pack;
MainLoop;

This code produces the widget shown in Figure 23-14.

Figure 23-14

Figure 23-14. A LabFrame widget



Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.