2 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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/Perl/bin/perl
use strict;
use warnings;
use Data::Dumper qw/Dumper/;
use DBI;
use Carp;
use SQL::Abstract;
use Tk;
use Tk::TableMatrix::Spreadsheet;
use Perl6::Say;
my $mw = tkinit();
my %gui = ();
my %table = ();
my $t = $mw->Scrolled(
'Spreadsheet',
-cols => 5,
-rows => 500,
-width => 5,
-height => 6,
-titlerows => 1,
-titlecols => 0,
-variable => \%table,
-selectmode => 'extended',
-selecttype => 'row',
-selecttitle => 0,
-state => 'disabled',
-bg => 'white',
-scrollbars => 'se',
);
$t->configure(-state => 'normal',);
$t->set('0,0', "IdNum");
$t->set('0,1', "Word");
$t->set('0,2', "Mann");
$t->set('0,3', "IdNumLemma");
$t->set('0,4', "FlectType");
$t->configure(-state => 'disabled',);
$t->pack(-fill => 'x');
# - Initialisierung
initFuelleTabelle($t);
# Jetzt die passenden Kommandos einbauen
$t->configure(
-rowtagcommand => sub{
my $row = shift;
say '-' x 40;
say localtime() . "";
say "Zeile: $row";
},
);
$mw->MainLoop();
=head1 METHODEN
=head2 initFuelleTabelle($t)
Füllt die Tabelle zum Programmstart mit Daten.
=cut
sub initFuelleTabelle {
my $table = shift;
# das jetzt nur mal so zum Testen für euch
for ( my $row = 1; $row < 10; $row++ ) {
$t->configure(-state => 'normal',);
$t->set("$row,0", "IdNum");
$t->set("$row,1", "Word");
$t->set("$row,2", "Mann");
$t->set("$row,3", "IdNumLemma");
$t->set("$row,4", "FlectType");
$t->configure(-state => 'disabled',);
} # /for
} # /initFuelleTabelle
1 2 3 4 5 6 7
-browsecommand => sub{ my ($von, $nach) = @_; my $row = (split(m/\,/, $nach))[0]; say "Zeile: $row"; }
2 Einträge, 1 Seite |