Leser: 1
7 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/perl
use Tk;
my($text1, $text2);
my $max_len = 8;
my $mw = tkinit;
my $entry1 = $mw->Entry(-textvariable => \$text1)->pack();
my $entry2 = $mw->Entry(-textvariable => \$text2)->pack();
$entry1->bind('<Key>' => sub { $text1 = substr($text1, 0, $max_len);
$entry2->focus() if length($text1) == $max_len;
});
$entry2->bind('<Key>' => sub { $text2 = substr($text2, 0, $max_len); });
MainLoop();
7 Einträge, 1 Seite |