#!/usr/bin/perl -w
use Tk;
use strict;

my $main=MainWindow->new;
my ($label, $text, $button);
$main->title('Test');
$label=$main->Label(
    -text=>'Test',
    -width=>10
    );
$text=$main->Entry(
    -width=>10);
$button=$main->Button(
    -text=>'Change',
    -command=>\&change);

foreach($label, $text, $button){
    $_->pack(-side=>"left",-fill=>"both");
}
MainLoop();

sub change(){
    $label->configure(-text=>$text->get());
}

arrow
arrow
    全站熱搜

    hechian 發表在 痞客邦 留言(0) 人氣()