my $id102 = $canvas->createWindow(36,30, -window =>$bt102);
my $bt103 = $canvas->Button(-text => "上个方法",
-command => \&printinfo);
my $id104 = $canvas->createWindow(36,200, -window =>$bt104);
my $bt105 = $canvas->createLine( 30,40,400,400, -fill => "green"
);
MainLoop;
sub printinfo
{
print "ok!\n";
}</p><p>
</p><p>但是下面的代码是有效的:</p><p>
</p><p>use Tk;</p><p>$mw = MainWindow->new( );
$mw->geometry("200x200");#1368
$mw->title("模式关系网");#
$mw->title("One Scrollbar/Three Listboxes");
$mw->Button(-text => "Exit",
-command => sub { exit })->pack(-side => 'bottom');</p><p>$scltest = $mw->Scrollbar( );</p><p>$txt = $mw->Text();</p><p># This method is called when one Listbox is scrolled with the keyboard
# It makes the Scrollbar reflect the change, and scrolls the other lists
sub scroll_Text {
my ($scltest, @args) = @_;
$scltest->set(@args); # tell the Scrollbar what to display $lbs,