Leser: 1
7 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
my $mw = tkinit();
my $titel = "titel";
my $text = "text";
my $dialog = $mw->Dialog(-title => $titel,-text => $text, -bitmap => 'info', -font=>'courier 8', -buttons => ['Jetzt', 'Später', 'Nie']);
#$dialog -> protocol( 'WM_DELETE_WINDOW'=>sub {exit(); } );
$dialog-> transient('');
$mw->withdraw();
my $answer = $dialog->Show();
if($answer eq "Jetzt"){
}
elsif ($answer eq "Später"){
}
elsif ($answer eq "Nie"){
my $titel = "titel";
my $text = "text";
my $bestaetigung = $mw->Dialog(-title => $titel,-text => $text, -font=>'courier 8', -buttons => ['Ja', 'Nein']);
my $antwort = $bestaetigung->show();
if($antwort eq "Ja"){
}
my $antwort = $bestaetigung->Show();
#$dialog -> protocol( 'WM_DELETE_WINDOW'=>sub {exit(); } );
#$dialog -> protocol( 'WM_DELETE_WINDOW'=>sub {exit(); } );
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
$mw->protocol('WM_DELETE_WINDOW', [ \&ExitApplication, $mw] ); # ------------------------------------------------------------ sub ExitApplication { my ($mw) = @_; my $dialog = $mw->Dialog(-text => 'Programm wirklich beenden?', -bitmap => 'question', -title => 'Programm beenden', -default_button => 'Yes', -buttons => [qw/Ja Nein/], ); my $answer = $dialog->Show(); # and display dialog if( lc($answer) eq 'ja' ){ exit; # oder: $mw->destroy(); } else { # continue } # else } # ExitApplication
7 Einträge, 1 Seite |