use Tk;
use GD;
use strict;

# MainWindow
my $mw = new MainWindow(-title => "Menubutton");
#$mw->geometry('800x600');

# Frame fuer das Menue
my $frame = $mw->Frame(-relief => "ridge", 
                       -borderwidth => 2)
                   ->pack(-side   => 'top', 
                          -anchor => 'n', 
                          -expand => 1, 
                          -fill   => 'x');

# Die Menues
my $mb1 = $frame->Menubutton(-text => "Datei")->pack(-side => "left");
$mb1->AddItems(["command" => "Oeffnen", -command => \&openfile]);
$mb1->AddItems(["command" => "Speichern", -command => \&savefile]);
$mb1->AddItems(["command" => "Schliessen", -command => \&closefile]);
$mb1->AddItems(["command" => "-"]);
$mb1->AddItems(["command" => "Beenden", -command => sub {exit;} ]);

my $mb2 = $frame->Menubutton(-text => "Bearbeiten")->pack(-side => "left");

my $mb3 = $frame->Menubutton(-text => "Optionen")->pack(-side => "left");

my $mb4 = $frame->Menubutton(-text => "Hilfe")->pack(-side => "right");
$mb4->AddItems(["command" => "Hilfe", -command => \&help]);
$mb4->AddItems(["command" => "-"]);
$mb4->AddItems(["command" => "About", -command => \&about]);

# Dummy-Funktionen
sub openfile {}
sub savefile {}
sub closefile {}
sub help {}
sub about {}

MainLoop;

