use strict; use warnings; use Tk; my $mw = MainWindow->new; my $bt1 = $mw->Button(-text => 'Show dialog', -command => \&showmsg)->pack; my $bt2 = $mw->Button(-text => 'bunt', -activebackground => 'red', -borderwidth => 6, -highlightbackground => 'green', -highlightcolor => 'yellow', -highlightthickness => 4)->pack; MainLoop; sub showmsg { my $antw = $mw->messageBox(-message => 'Exit?', # -background => 'orange', # nicht bei Windows ! -type => 'YesNo', -default => 'No'); $antw eq 'Yes' and exit; return; }