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
#!/usr/bin/perl
use strict;
use warnings;
use Tk;
use Tk::NoteBook;
my $main = MainWindow->new();
my $note = $main->NoteBook()->pack();
my $page1 = $note->add(
'Notebook-1',
-label => 'ReiterEins'
);
my $page2 = $note->add(
'Notebook-2',
-label => 'ReiterZwei',
-raisecmd => \&test
);
my $text = '';
my $label = $page2->Label(-textvariable => \$text)->pack();
my $entry = $page1->Entry()->pack();
$entry->focus();
MainLoop();
sub test {
$text = $entry->get();
$entry->delete('0.0','end');
}
du hattest immer ein neues label angelegt!