Leser: 25
QuoteUndefined subroutine &window::Mainloop called at window.pm line 35
1
2
3
4
5
6
7
8
9
#!/usr/bin/perl -w
use strict;
use warnings;
use window;
my $wm= window->new();
$wm->set_xy(128,133);
$wm->set_tittle('program');
$wm->set_window();
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
package window;
use strict;
use warnings;
use Tk;
sub new {
my $this = shift;
my $self = {};
bless ($self, $this);
return $self;
}
sub set_xy {
my $this = shift;
if(@_) {$this->{'windowHeight'} = shift};
if(@_) {$this->{'windowWidth'} = shift};
}
sub set_tittle {
my $this = shift;
if(@_) {$this->{'tittle'} = shift};
}
sub set_window {
my $this = shift;
my $mw = MainWindow->new();
$mw->title($this->{'tittle'});
my $screenHeight = $mw->screenheight;
my $screenWidth = $mw->screenwidth;
$mw->geometry($this->{'windowWidth'} . "x" . $this->{'windowHeight'});
$mw->geometry("+" . int($screenWidth/2 -
$this->{'windowWidth'}/2) . "+" . int($screenHeight/2 -
$this->{'windowHeight'}/2));
Mainloop();
}
2010-07-09T09:28:40 jetcki[...]
Beim ausführen bekomme ich die Fehlermeldung:
QuoteUndefined subroutine &window::Mainloop called at window.pm line 35
Was mache ich falsch?
[...]