Leser: 1
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
sub show_rooms {
my @rooms = &get_rooms;
for (@rooms) {
$_ = $left_frame -> Button(-text => $_) -> pack(-side => 'top', -anchor => 'center', -fill => 'x');
push(@left_frame_widgets, $_);
}
#$leftFrame -> Button(-text => 'Test') -> pack(-side => 'top', -anchor => 'center');
my $b1 = $left_frame -> Button(-text => 'Hinzufuegen', -command => sub{&add_room;}) -> pack(-side => 'left');
my $b2 = $left_frame -> Button(-text => 'Bearbeiten', -command => sub{&change_rooms('e');}) -> pack(-side => 'left');
my $b3 = $left_frame -> Button(-text => 'Entfernen', -command => sub{&dst_wg;}) -> pack (-side =>'left');#&change_rooms('d');}) -> pack(-side => 'left');
push(@left_frame_widgets, $b1, $b2, $b3);
}
sub dst_wg {
for (@left_frame_widgets) {
$_ -> destroy();
}
@left_frame_widgets = "";
}
1
2
3
4
5
6
7
stefan@static:~/programmierung/perl/lagerverwaltung$ perl lager.pl
Tk::Error: Can't call method "destroy" without a package or object reference at lager.pl line 95.
[\&main::__ANON__]
Tk callback for .frame.frame.button14
Tk::__ANON__ at /usr/lib/perl5/Tk.pm line 225
Tk::Button::butUp at /usr/lib/perl5/Tk/Button.pm line 111
(command bound to event)
1
2
3
4
5
6
sub dst_wg {
for (@left_frame_widgets) {
$_ -> destroy();
}
@left_frame_widgets = ();
}
1
2
3
4
5
6
sub dst_wg {
for (@left_frame_widgets) {
$_ -> destroy();
}
@left_frame_widgets = ();
}
4 Einträge, 1 Seite |