use strict;
use warnings;
use Tk;

# Das MainWindow erzeugen
my $mw = MainWindow->new;

# MainWindow: Groesse-X und -Y, Position -X und -Y
$mw->geometry("220x250+100+120");

# Titelzeile
$mw->title("Die Suche nach Weisheit");

# Textfeld im Fenster
my $text = $mw->Label(-text=>"Hallo Universum!",
                      -font => "Helvetica -20 bold" );
$text ->pack;

# Alternativ gleich beides:
# $mw->Label( -text=>"Hallo Universum!",
#             -font => "Helvetica -20 bold" 
#           )->pack;

# Ein Button zum Beenden
$mw->Button( -text => "Drück mich",
             -width=>'20',                  # Breite
             -height=>'10',                 # Hoehe
             -borderwidth=> '4',            # Randbreite
             -relief => 'raised',           # Randform
             
             -foreground => 'red',          # Standardvorder-
             -background => 'yellow',       # und Hintergrund
             
             -activebackground => 'green',  # dito, wenn die
             -activeforeground => 'white',  # Maus drueber ist
             
             -cursor => 'cross',            # Mauscursor-Form
             -command => [$mw => 'destroy']
           )->pack;

my $time = localtime();
$mw->Button(-textvariable => \$time,
            -command => sub { $time = localtime() },
           )
            ->pack();

MainLoop;
