9 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
#!/usr/bin/perl
use strict;
use my_tk;
my $fenster = my_tk->new();
MainLoop();
package my_tk;
use base 'Tk';
sub new {
my $class = shift;
my $self = $class->SUPER::MainWindow->new(@_);
# ggf. mach was mit $self
return $self;
}
1;
1
2
3
4
5
6
7
8
9
#!/usr/bin/perl
use strict;
use lib qw(.);
use my_tk qw(MainLoop);
my $fenster = my_tk->new();
MainLoop();
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package my_tk;
require Exporter;
our @EXPORT = qw(MainLoop);
use base 'Tk';
sub new {
my $class = shift;
my $self = MainWindow->new(@_);
# ggf. mach was mit $self
return $self;
}
sub MainLoop{
Tk::MainLoop();
}
1;
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
package mytk;
use strict;
use warnings;
use base 'Tk::MainWindow';
sub new {
my $class = shift;
my $self = $class->SUPER::new(@_);
return ($self);
}
sub run {
my $self = shift;
$self->SUPER::MainLoop;
}
1;
my $wnd = mytk->new;
$wnd->run;
9 Einträge, 1 Seite |