#!/usr/bin/perl use strict; use warnings 'all'; use Tk; use Tk::Balloon; # MainWindow erstellen my $mw = tkinit(-title => "Tk::Balloon"); # menuframe und statusframe erstellen my $mf = $mw -> Frame ( -relief => "flat" , -bd => 1 ) -> pack ( -fill => "x" , -expand => 1 ); my $sf = $mw -> Frame ( -relief => "groove" , -bd => 1 ) -> pack ( -fill => "x" , -expand => 1 ); # MenĂ¼ erstellen my $menubar = $mf -> Menu ( -type => "menubar" , -menuitems => [ [ "cascade" => "Datei" , -tearoff => 0 , -menuitems => [ [ "command" => "Neu" , -command => sub { print"neu\n" } ] , "-" , [ "command" => "Beenden" , -command => sub { $mw->destroy } ] ] ] ] ); $mw -> configure ( -menu => $menubar ); # Statuslabel erstellen my $sl = $sf -> Label ( -text => "Starttext" , -font => "{Arial} 10 {normal}" ) -> pack ( -side => "left" , -padx => 2 , -pady => 2 ); # Balloon erstellen my $b = $mw -> Balloon ( -statusbar => $sl , -initwait => 1 , -state => "status" ); $b -> attach ( $sf , -msg => "Statusbar" ); # attach() menu entrys $b -> attach ( $menubar , -state => "status" , -msg => [ "MenĂ¼: Datei" , "Eine neue Datei erstellen" , "Programm beenden" ] ); MainLoop;