Thread OK und Abbrechen (7 answers)
Opened by [E|B] at 2005-08-16 18:04

Crian
 2005-08-16 18:12
#44379 #44379
User since
2003-08-04
5866 Artikel
ModeratorIn
[Homepage]
user image
mit Tk::Dialog

(Details folgen, kleinen Moment...)

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/perl
use strict;
use warnings;

use Tk;
use Tk::Dialog;

my $mw = MainWindow->new(-title => 'Demonstration von Tk::Dialog');

$mw->Button(
-text => 'Dialog öffnen',
-command => \&button_start,
)->pack(
-side => 'top',
-fill => 'none',
-expand => 1,
-ipadx => 10,
-ipady => 5,
);

$mw->geometry('300x100');

MainLoop();

sub button_start {
my $dialog = $mw->Dialog(
-text => "Text, der im Dialog angezeigt wird.\n".
"mit \\n können Umbrüche erzeugt werden.",
-bitmap => 'info',
-title => 'unser schöner neuer Dialog',
-default_button => 'OK',
-buttons => [ 'OK', 'Toll', 'Find ich klasse :-)',
'Nun reicht\'s' ],
-font => '{Times New Roman} 12 {normal}',
);

my $answer = $dialog->Show(-global);

print "Antwort war: $answer\n";

exit(0) if $answer eq 'Nun reicht\'s';
}
\n\n

<!--EDIT|Crian|1124201734-->
s--Pevna-;s.([a-z]).chr((ord($1)-84)%26+97).gee; s^([A-Z])^chr((ord($1)-52)%26+65)^gee;print;

use strict; use warnings; Link zu meiner Perlseite

View full thread OK und Abbrechen