Skip Menu |

This queue is for tickets about the Tk-TableMatrix CPAN distribution.

Report information
The Basics
Id: 111901
Status: resolved
Priority: 0/
Queue: Tk-TableMatrix

People
Owner: Nobody in particular
Requestors: JAMarkham [...] eganco.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Bug in Tk::TableMatrix 1.23
Date: Tue, 9 Feb 2016 18:19:44 +0000
To: "bug-Tk-TableMatrix [...] rt.cpan.org" <bug-Tk-TableMatrix [...] rt.cpan.org>
From: "Joe A. Markham" <JAMarkham [...] eganco.com>
Hello- I think I have found a minor bug in Tk::TableMatrix version 1.23. When there are columns specified as title columns in the table definition, the columns cannot be spanned. Relevant info: Tk::TableMatrix 1.23 Tk 804.033 Perl V5.22.1 Windows 7 Professional, Service Pack 1 (Version 6.1.7601) This script will reproduce the error on my system: ########################################## use strict; use warnings;use Tk; use Tk::TableMatrix::Spreadsheet; my $table = {}; for (my $i=0;$i<3;$i++){ for (my $j=0;$j<3;$j++){ $table->{"$i,$j"}="Row $i Col $j"; } } #Spreadsheet without title rows and columns my $mwt = MainWindow->new( ); my $t = $mwt->Scrolled('Spreadsheet', -rows => 3, -cols => 3, -width => 6, -height => 6, # -titlerows => 1, -titlecols => 1, -variable => $table, ); $t->spans("0,0","0,3"); $t->spans("2,1","2,2"); $t->pack(-expand => 1, -fill => 'both'); #Spreadsheet with title row my $t2 = $mwt->Scrolled('Spreadsheet', -rows => 3, -cols => 3, -width => 6, -height => 6, -titlerows => 1, -variable => $table, ); $t2->spans("0,0","0,3"); $t2->spans("2,1","2,2"); $t2->pack(-expand => 1, -fill => 'both'); #Spreadsheet with title row & column - this one shows the bug my $t3 = $mwt->Scrolled('Spreadsheet', -rows => 3, -cols => 3, -width => 6, -height => 6, -titlerows => 1, -titlecols => 1, -variable => $table, ); $t3->spans("0,0","0,3"); $t3->spans("2,1","2,2"); $t3->pack(-expand => 1, -fill => 'both'); MainLoop; Thank you for looking at this. Please feel free to contact me if any of the above is unclear or insufficient. -Joe JOE MARKHAM, Industrial Controls Engineer [Egan Logo]<http://www.eganco.com/> www.eganco.com<http://www.eganco.com/> direct: 763.591.5525 // cell: 612.244.0114 24 hour service: 763.595.4300 email: jamarkham@eganco.com<mailto:jamarkham@eganco.com> 7115 Northland Terrace N #400, Brooklyn Park, MN 55428 [Title: Engage with Egan on Facebook]<https://www.facebook.com/pages/Egan-Company/104384879628629>[Follow Egan on LinkedIn]<https://www.linkedin.com/company/89746>[Subscribe to Egan videos on YouTube]<https://www.youtube.com/user/EganCompanyMN>

Message body is not shown because it is too large.

Download image001.png
image/png 2.1k
image001.png
Download image002.png
image/png 5.9k
image002.png
Download image003.jpg
image/jpeg 782b
image003.jpg
Download image004.png
image/png 1.1k
image004.png
Download image005.png
image/png 1.2k
image005.png
Thanks for sending the bug report with a working example that shows the problem. That really helps to zero in on the issue. Unfortunately, this is an issue with the base TkTable widget (see http://wiki.tcl.tk/1877 ) that Tk::TableMatrix is based on. From the documentation of the widget, under the "Row/Col Spanning" section, you could interpret that this is expected behavior: "Cells in the title area that span are not permitted to span beyond the title area, and will be constrained accordingly. " You are trying to span a column in the titlecol area into the titlerow area, which the TableMatrix code restricts as stated in the docs. I have run across this issue before in my code before and ended up just spanning the columns in the titlerows that aren't part of the title cols. See below for an example of the workaround. use strict; use warnings;use Tk; use Tk::TableMatrix::Spreadsheet; my $table = {}; for (my $i=0;$i<3;$i++){ for (my $j=0;$j<3;$j++){ $table->{"$i,$j"}="Row $i Col $j"; } } #Spreadsheet without title rows and columns my $mwt = MainWindow->new( ); #Spreadsheet with title row & column - this one is a workaround # for TableMatrix not spanning rows across a titleCol into a titleRow $table->{"0,0"}= ""; my $t3 = $mwt->Scrolled('Spreadsheet', -rows => 3, -cols => 3, -width => 6, -height => 6, -titlerows => 1, -titlecols => 1, -variable => $table, ); $t3->spans("0,1","0,2"); $t3->spans("2,1","2,2"); $t3->pack(-expand => 1, -fill => 'both'); MainLoop; On Tue Feb 09 13:19:58 2016, JAMarkham@eganco.com wrote: Show quoted text
> Hello- > > I think I have found a minor bug in Tk::TableMatrix version 1.23. When > there are columns specified as title columns in the table definition, > the columns cannot be spanned. > > Relevant info: > > Tk::TableMatrix 1.23 > Tk 804.033 > Perl V5.22.1 > Windows 7 Professional, Service Pack 1 (Version 6.1.7601) > > This script will reproduce the error on my system: > ########################################## > > use strict; > use warnings;use Tk; > use Tk::TableMatrix::Spreadsheet; > my $table = {}; > for (my $i=0;$i<3;$i++){ > for (my $j=0;$j<3;$j++){ > $table->{"$i,$j"}="Row $i Col $j"; > } > } > #Spreadsheet without title rows and columns > my $mwt = MainWindow->new( ); > my $t = $mwt->Scrolled('Spreadsheet', -rows => 3, -cols => 3, > -width => 6, -height => 6, > # -titlerows => 1, -titlecols => 1, > -variable => $table, > ); > $t->spans("0,0","0,3"); > $t->spans("2,1","2,2"); > $t->pack(-expand => 1, -fill => 'both'); > > #Spreadsheet with title row > my $t2 = $mwt->Scrolled('Spreadsheet', -rows => 3, -cols => 3, > -width => 6, -height => 6, > -titlerows => 1, > -variable => $table, > ); > $t2->spans("0,0","0,3"); > $t2->spans("2,1","2,2"); > $t2->pack(-expand => 1, -fill => 'both'); > > #Spreadsheet with title row & column - this one shows the bug > my $t3 = $mwt->Scrolled('Spreadsheet', -rows => 3, -cols => 3, > -width => 6, -height => 6, > -titlerows => 1, -titlecols => 1, > -variable => $table, > ); > $t3->spans("0,0","0,3"); > $t3->spans("2,1","2,2"); > $t3->pack(-expand => 1, -fill => 'both'); > MainLoop; > > > Thank you for looking at this. Please feel free to contact me if any > of the above is unclear or insufficient. > > -Joe > > > JOE MARKHAM, Industrial Controls Engineer > > > [Egan Logo]<http://www.eganco.com/> > > www.eganco.com<http://www.eganco.com/> > > direct: 763.591.5525 // cell: 612.244.0114 > 24 hour service: 763.595.4300 > email: jamarkham@eganco.com<mailto:jamarkham@eganco.com> > 7115 Northland Terrace N #400, Brooklyn Park, MN 55428 > [Title: Engage with Egan on > Facebook]<https://www.facebook.com/pages/Egan- > Company/104384879628629>[Follow Egan on > LinkedIn]<https://www.linkedin.com/company/89746>[Subscribe to Egan > videos on YouTube]<https://www.youtube.com/user/EganCompanyMN>
Subject: RE: [rt.cpan.org #111901] Bug in Tk::TableMatrix 1.23
Date: Tue, 9 Feb 2016 21:22:01 +0000
To: "bug-Tk-TableMatrix [...] rt.cpan.org" <bug-Tk-TableMatrix [...] rt.cpan.org>
From: "Joe A. Markham" <JAMarkham [...] eganco.com>
Thanks for the quick response! I was afraid that would be the answer. Thank you for the workaround! -Joe JOE MARKHAM EGAN COMPANY  //  Industrial Controls Engineer DIRECT: 763.591.5525 (EXT 525) Show quoted text
-----Original Message----- From: CERNEY via RT [mailto:bug-Tk-TableMatrix@rt.cpan.org] Sent: Tuesday, February 09, 2016 3:03 PM To: Joe A. Markham <JAMarkham@eganco.com> Subject: [rt.cpan.org #111901] Bug in Tk::TableMatrix 1.23 <URL: https://rt.cpan.org/Ticket/Display.html?id=111901 > Thanks for sending the bug report with a working example that shows the problem. That really helps to zero in on the issue. Unfortunately, this is an issue with the base TkTable widget (see http://wiki.tcl.tk/1877 ) that Tk::TableMatrix is based on. From the documentation of the widget, under the "Row/Col Spanning" section, you could interpret that this is expected behavior: "Cells in the title area that span are not permitted to span beyond the title area, and will be constrained accordingly. " You are trying to span a column in the titlecol area into the titlerow area, which the TableMatrix code restricts as stated in the docs. I have run across this issue before in my code before and ended up just spanning the columns in the titlerows that aren't part of the title cols. See below for an example of the workaround. use strict; use warnings;use Tk; use Tk::TableMatrix::Spreadsheet; my $table = {}; for (my $i=0;$i<3;$i++){ for (my $j=0;$j<3;$j++){ $table->{"$i,$j"}="Row $i Col $j"; } } #Spreadsheet without title rows and columns my $mwt = MainWindow->new( ); #Spreadsheet with title row & column - this one is a workaround # for TableMatrix not spanning rows across a titleCol into a titleRow $table->{"0,0"}= ""; my $t3 = $mwt->Scrolled('Spreadsheet', -rows => 3, -cols => 3, -width => 6, -height => 6, -titlerows => 1, -titlecols => 1, -variable => $table, ); $t3->spans("0,1","0,2"); $t3->spans("2,1","2,2"); $t3->pack(-expand => 1, -fill => 'both'); MainLoop; On Tue Feb 09 13:19:58 2016, JAMarkham@eganco.com wrote:
> Hello- > > I think I have found a minor bug in Tk::TableMatrix version 1.23. When > there are columns specified as title columns in the table definition, > the columns cannot be spanned. > > Relevant info: > > Tk::TableMatrix 1.23 > Tk 804.033 > Perl V5.22.1 > Windows 7 Professional, Service Pack 1 (Version 6.1.7601) > > This script will reproduce the error on my system: > ########################################## > > use strict; > use warnings;use Tk; > use Tk::TableMatrix::Spreadsheet; > my $table = {}; > for (my $i=0;$i<3;$i++){ > for (my $j=0;$j<3;$j++){ > $table->{"$i,$j"}="Row $i Col $j"; > } > } > #Spreadsheet without title rows and columns my $mwt = MainWindow->new( > ); my $t = $mwt->Scrolled('Spreadsheet', -rows => 3, -cols => 3, > -width => 6, -height => 6, > # -titlerows => 1, -titlecols => 1, > -variable => $table, > ); > $t->spans("0,0","0,3"); > $t->spans("2,1","2,2"); > $t->pack(-expand => 1, -fill => 'both'); > > #Spreadsheet with title row > my $t2 = $mwt->Scrolled('Spreadsheet', -rows => 3, -cols => 3, > -width => 6, -height => 6, > -titlerows => 1, > -variable => $table, > ); > $t2->spans("0,0","0,3"); > $t2->spans("2,1","2,2"); > $t2->pack(-expand => 1, -fill => 'both'); > > #Spreadsheet with title row & column - this one shows the bug my $t3 = > $mwt->Scrolled('Spreadsheet', -rows => 3, -cols => 3, > -width => 6, -height => 6, > -titlerows => 1, -titlecols => 1, > -variable => $table, > ); > $t3->spans("0,0","0,3"); > $t3->spans("2,1","2,2"); > $t3->pack(-expand => 1, -fill => 'both'); MainLoop; > > > Thank you for looking at this. Please feel free to contact me if any > of the above is unclear or insufficient. > > -Joe > > > JOE MARKHAM, Industrial Controls Engineer > > > [Egan Logo]<http://www.eganco.com/> > > www.eganco.com<http://www.eganco.com/> > > direct: 763.591.5525 // cell: 612.244.0114 > 24 hour service: 763.595.4300 > email: jamarkham@eganco.com<mailto:jamarkham@eganco.com> > 7115 Northland Terrace N #400, Brooklyn Park, MN 55428 > [Title: Engage with Egan on > Facebook]<https://www.facebook.com/pages/Egan- > Company/104384879628629>[Follow Egan on > LinkedIn]<https://www.linkedin.com/company/89746>[Subscribe to Egan > videos on YouTube]<https://www.youtube.com/user/EganCompanyMN>