Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
use Tk; use Tk::TableMatrix::SpreadsheetHideRows; my $top = MainWindow->new; my $arrayVar = {}; my @rawdata = (qw/ Quarter Month Region State AvgTemp 1 -- South -- 39 2 -- South -- 61 3 -- South -- 65 4 -- South -- 45 /); foreach my $row (0..4){ foreach my $col (0..5){ next if( $col == 0); $arrayVar->{"$row,$col"} = shift @rawdata; } } my $expandData = { 1 => { data => [ [ '','','Jan', 'South','--',33], [ '','','Feb', 'South','--',38], [ '','','Mar', 'South','--',45], ], tag => 'detail', expandData => { 1 => { data => [ [ '','','', '','Texas',35], [ '','','', '','Ok',36], [ '','','', '','Ark',37], ], tag => 'detail2', }, 2 => { data => [ [ '','','', '','Texas',41], [ '','','', '','Ok',42], [ '','','', '','Ark',43], ], tag => 'detail2', }, 3 => { data => [ [ '','','', '','Texas',51], [ '','','', '','Ok',52], [ '','','', '','Ark',53], ], tag => 'detail2', }, }, }, 2 => { data => [ [ '','','Apr', 'South','--',55], [ '','','May', 'South','--',61], [ '','','Jun', 'South','--',68], ], tag => 'detail', expandData => { 2 => { data => [ [ '','','', '','Texas',58], [ '','','', '','Ok',65], [ '','','', '','Ark',60], ], tag => 'detail2', } } }, 3 => { data => [['',"Testing \nMultiple \nRows"]], tag => 'detail', spans => [ 1 => '2,3'] }, 4 => { data => [['','Sorry, Detail Data Not Available Until Next +month']], tag => 'detail', spans => [ 1 => '0,3'] }, }; my $t = $top->Scrolled('SpreadsheetHideRows', -rows => 5, -cols => 6, -width => 6, -height => 6, -titlerows => 1, -titlecols => 1, -variable => $arrayVar, -selectmode => 'extended', -resizeborders => 'both', -selectorCol => 0, -expandData => $expandData # -state => 'disabled' # -colseparator => "\t", # -rowseparator => "\n" ); # Tags for the detail data: $t->tagConfigure('detail', -bg => 'palegreen', -relief => 'sunken'); $t->tagConfigure('detail2', -bg => 'lightskyblue1', -relief => 'sunken +'); $t->pack(-expand => 1, -fill => 'both'); Tk::MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: SpreadSheetHideRows with multiple rows ?
by ldln (Pilgrim) on Aug 31, 2005 at 14:30 UTC | |
by Anonymous Monk on Aug 31, 2005 at 16:51 UTC |