![]() |
![]() |
4 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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/local/bin/perl -w
use Tk 8.0;
use strict;
my $mw = MainWindow->new;
$mw->geometry('350x175');
my $menubar = $mw->Menu;
$mw->configure(-menu => $menubar);
my $file = $menubar->cascade(-label => '~Datei');
$file->command(-label => 'Ausführen', -command => \&leeres_info_fenster);
$file->command(-label => 'E~xit', -command => \&ExitApplication);
MainLoop;
# *****************************************************************************
# ** Sub LEERES INFO FENSTER **************************************************
# *****************************************************************************
sub leeres_info_fenster {
my $popup = $mw->Dialog(
-popover => $mw,
-title => 'Leeres INFO Fenster',
-bitmap => 'Tk',
-default_button => 'OK',
-buttons => ['OK'],
-text => "Diese Funktion ist noch\n".
"nicht aktiviert. \n",
);
$popup->resizable('no', 'no');
$popup->Show();
}
# *****************************************************************************
# ** Sub Programm_Ausfuehren **************************************************
# *****************************************************************************
sub Programm_Ausfuehren {
# Hier sollte ein Unterprogram (z.B. C:\TEST\TEST.PL), ausgeführt werden
# sobald ich vorher den Button "Ausführen" gedrückt habe. Wie muss diese
# Routine hier kodiert werden?
}
# *****************************************************************************
# ** Sub ExitApplication ******************************************************
# *****************************************************************************
sub ExitApplication {
my $dialog = $mw->Dialog(-text => 'Anwendung wirklich beenden?',
-bitmap => 'question',
-title => 'Anwendung verlassen?',
-default_button => 'Yes',
-buttons => [qw/Yes No/],
);
my $answer = $dialog->Show();
if ($answer =~ /y/i){
exit;
}
else {
}
}
do "test.pl"
system("perl", "test.pl");
system("perl", "test.pl");
system($^X, "test.pl");
![]() |
![]() |
4 Einträge, 1 Seite |