5
# Create a top-level window that displays a bunch of labels.
7
$mkLabel->destroy if Exists($mkLabel);
8
$mkLabel = $top->Toplevel();
11
$w->title('Label Demonstration');
12
$w->iconname('Labels');
14
my $w_msg = $w->Message(-font => '-Adobe-times-medium-r-normal--*-180-*-*-*-*-*-*', -aspect => 300,
15
-text => 'Five labels are displayed below: three textual ones on the left, and a bitmap label ' .
16
'and a text label on the right. Labels are pretty boring because you can\'t do anything with ' .
17
'them. Click the "OK" button when you\'ve seen enough.');
18
my $w_left = $w->Frame();
19
my $w_right = $w->Frame();
20
my $w_ok = $w->Button(-text => 'OK', -command => ['destroy', $w], -width => 8);
21
$w_msg->pack(-side => 'top');
22
$w_ok->pack(-side => 'bottom');
23
my(@pl) = (-side => 'left', -expand => 'yes', -padx => 10, -pady => 10, -fill => 'both');
27
my $w_left_l1 = $w_left->Label(-text => 'First label');
28
my $w_left_l2 = $w_left->Label(-text => 'Second label, raised just for fun', -relief => 'raised');
29
my $w_left_l3 = $w_left->Label(-text => 'Third label, sunken', -relief => 'sunken');
30
@pl = (-side => 'top', -expand => 'yes', -pady => 2, -anchor => 'w');
31
$w_left_l1->pack(@pl);
32
$w_left_l2->pack(@pl);
33
$w_left_l3->pack(@pl);
35
my $w_right_bitmap = $w_right->Label(-bitmap => '@'.Tk->findINC('demos/images/face'), -borderwidth => 2,
37
my $w_right_caption = $w_right->Label(-text => 'Tcl/Tk Proprietor');
38
$w_right_bitmap->pack(-side => 'top');
39
$w_right_caption->pack(-side => 'top');