#!/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