5
# Create a top-level window that displays a bunch of buttons.
7
$mkButton->destroy if Exists($mkButton);
8
$mkButton = $top->Toplevel();
11
$w->title('Button Demonstration');
12
$w->iconname('Buttons');
14
my $w_msg = $w->Message(-font => '-Adobe-times-medium-r-normal--*-180-*-*-*-*-*-*', -aspect => 300,
15
-text => 'If you click on any of the top four buttons below, the background of the button ' .
16
'area will change to the color indicated in the button. Click the "OK" button when you\'ve ' .
18
$w_msg->pack(-side => 'top', -fill => 'both');
20
my($w_b1, $w_b2, $w_b3, $w_b4, $w_ok);
21
$w_b1 = $w->Button(-text => 'Peach Puff', -width => 10, -command => [sub {shift->configure(-bg => 'PeachPuff1')}, $w]);
22
$w_b2 = $w->Button(-text => 'Light Blue', -width => 10, -command => [sub {shift->configure(-bg => 'LightBlue1')}, $w]);
23
$w_b3 = $w->Button(-text => 'Sea Green', -width => 10, -command => [sub {shift->configure(-bg => 'SeaGreen2')}, $w]);
24
$w_b4 = $w->Button(-text => 'Yellow', -width => 10, -command => [sub {shift->configure(-bg => 'Yellow1')}, $w]);
25
$w_ok = $w->Button(-text => 'OK', -width => 10, -command => ['destroy', $w]);
26
my(@pl) = (-side => 'top', -expand => 'yes', -pady => 2);