Washizu has asked for the wisdom of the Perl Monks concerning the following question:

The Problem:
I'm using TableMatrix to store some data and I need some of the cells to span rows. Everything works fine if I span rows in the middle of the table, but it breaks if I try to span a cell in the last column to the end of the table. When this happens the last row and column both disappear from the table.

The Example:
I worked for a while isolating the cause of the disappearing cells and here is a very simple example of the problem:

#!/usr/local/bin/perl5 -w # Use Perl 5 with warnings # Simple TableMatrix Bug Example # Using ActiveState Perl v5.6.1 # Build 628 use strict; use Tk; use Tk::TableMatrix; my $main = new MainWindow; my $table = $main->TableMatrix()->pack( -side => 'top' ); # Description of the "spans" method from http://www.perldoc.com/cpan/T +ableMatrix.html # $table->spans(?index?, ?rows,cols, index, rows,cols, ...?) #$table->spans("0,8", "9,0"); # Works fine. Cell 0,8 spans down 10 + rows of the table. #$table->spans("0,9", "8,0"); # Works fine. Cell 0,9 spans down 9 + rows of the table. $table->spans("0,9", "9,0"); # Table breaks. Last row and column +disappear. MainLoop;

If anyone could test this on something other than ActiveState's build I'd appreciate it. I've downloaded the latest versions of Tk and TableMatrix as well.

Thanks Monks.

-----------------------------------
Washizu
Acoustic Rock

Replies are listed 'Best First'.
Re: TableMatrix Bug?
by Zaxo (Archbishop) on Sep 18, 2002 at 22:08 UTC

    Verified the behavior, perl, v5.6.1 built for i686-linux, $Tk::TableMatrix::VERSION is 0.9 .

    Update: By selecting a cell, it appears that the last column becomes hidden, rather than deleted. Rendering the last row looks half-hidden. To do with spanning cells with different default properties?

    After Compline,
    Zaxo

      Thanks for the verification. It behaves for me exactly as you described. I can get around it by adding an additional row to the table, but that doesn't look right to me.

      -----------------------------------
      Washizu
      Acoustic Rock