#!/usr/bin/perl use warnings; use strict; use Tk; my $mw = Tk::MainWindow->new(); $mw->title("Window"); $mw->optionAdd("*font", "Arial 15 normal"); my $text = $mw->Text(-width => 80, -height => 10, -fg => 'black', -bg => 'white'); $text->pack(-padx => 10, -pady => 10); my $eingabe = $mw->Entry(-width => 60, -fg => 'black', -bg => 'white'); $eingabe->bind("", sub { processInput($eingabe, $text);} ); $eingabe->focus(); $eingabe->pack(-pady => 10); $mw->MainLoop(); sub processInput { my $eingabe = shift; my $text = shift; my $s = $eingabe->get(); $eingabe->delete(0, "end"); $text->insert("end", "$s\n"); }