#!/user/bin/perl -w use strict; use Tk; my $counter = 0; my $haupt = new MainWindow; my $links= $haupt->Frame(); $links->Label(-text => "Geben Sie einen Namen fuer die Datei an:")->pack(); my $ein = $links->Entry(); $ein->pack(); my $schalter = $links->Button(-text => "Eintragen", -command => \&eintragen )->pack(); my $schalter2 = $links->Button(-text => "Beenden", -command=>[$haupt => 'destroy'] )->pack(-pady => "10"); my $rechts= $haupt ->Frame(); $rechts->Label(-text =>"Text Ausgabe:")->pack(); my $daten = $rechts ->Listbox(); $daten->pack(); $links ->pack(-side =>"left"); $rechts ->pack(-side =>"right"); MainLoop(); sub eintragen { $daten->insert('end', $counter."". $ein->get()); $counter++; }