Problem with SpreadSheet

Problem with SpreadSheet

Post by Joy » Thu, 28 Sep 2006 15:40:33


Hi All,
I am getting a strange problem with spreadsheet.
When the number of rows is greater than 1000, then the program
is being terminated on clicking the mouse on the title bar.
But it is working fine with less than 1000 rows.

My program is something like this:

$customize_spreadsheet_New_Upper =
$customize_dlg_topFrame_New->Scrolled(
'Spreadsheet',-rows=>21, -cols => 11,
-width => 6, -height => 6,
-titlerows => 1, -titlecols => 1,
-variable => $arrayVar,
-selectmode => 'extended',
-resizeborders => 'both',
-drawmode=> 'compatible',
-titlerows => 1,
-titlecols => 1,
-bg => 'white',
)->pack(qw/-expand 1 -fill both -padx 10 -pady 5/);

$arrayVar->{"0,1"} = "Value";


Now I am inserting into it in the following way.
my $used_rows_new_upper = 0;

sub updateSpreadSheetData{
for( 0..1000){
insertIntoSpreadSheet();
}
}

sub insertIntoSpreadSheet{
$used_rows_new_upper++;
$customize_spreadsheet_New_Upper->insertRows($used_rows_new_upper,1);
$arrayVar->{"$used_rows_new_upper,1"} = "Value1";
}

I don't know whether it is a bug of TK or mine.
Please let me know in case of any issue.
I am waiting for your reply.

Thanks & regards,
Joy
 
 
 

Problem with SpreadSheet

Post by bdz » Fri, 29 Sep 2006 06:34:11


I am sure you noticed that your updateSpreadSheetData sub (above) only
handles 1000 rows. :-)

sometimes these things slip by all of us.

 
 
 

Problem with SpreadSheet

Post by Joy » Fri, 29 Sep 2006 16:02:15


Hi,
I have written an independent application & I am also getting the
same problem here.

My independent application is as below.

#!/usr/bin/perl

use Tk;
use Tk::TableMatrix::Spreadsheet;

$mw = MainWindow->new;
$mw->configure(-title=>'Testing');
$mw->minsize(qw(500 200));
$menu = $mw->Frame()->pack(-side=>'top',-fill=>'x');
$menu_file =
$menu->Menubutton(-text=>'File',-tearoff=>'false')->pack(-side=>'left');
$menu_file->command(-label=>'Exit',-command=>sub{$mw->destroy});
$frame =
$mw->Frame(-height=>'10',-width=>'30',-relief=>'groove',-borderwidth=>'3')->pack(-fill=>'x',-pady=>'0');

@border = (0,0,0,1);

$arrayVar->{"0,0"} = "%";
$arrayVar->{"0,1"} = "Artist";
$arrayVar->{"0,2"} = "Album";
$arrayVar->{"0,3"} = "Year";
$arrayVar->{"0,4"} = "Genre";
$table = $frame->Scrolled('Spreadsheet',
-cols => 25,
-width => 5, -height => 6,
-titlerows => 1,
-variable => $arrayVar,
-selectmode => 'multiple',
-selecttype => 'row',
-resizeborders => 'col',
-bg => 'white',
-rowheight => 2,
-bd => \@border,
-justify => 'left',
-drawmode => 'compatible',
-wrap => 0,
-relief => 'solid'
)->pack(-fill=>'both');
$table->rowHeight(0,1);
$table->tagRow('title',0);
$table->tagConfigure('title', -bd=>2, -relief=>'raised');
$table->colWidth(0,5,3,6,4,10);

my $used_rows_new_upper;
for($used_rows_new_upper = 1; $used_rows_new_upper<400;
$used_rows_new_upper++){
$table->insertRows($used_rows_new_upper,1);
$arrayVar->{"$used_rows_new_upper,1"} = "ABC";
}
MainLoop();
1;

Regards,
Joy
 
 
 

Problem with SpreadSheet

Post by zentar » Sat, 30 Sep 2006 00:32:26


I ran your example here, and it did not crash by clicking on the title
bar. I'm using linux with the latest Tk.
Maybe you should say what version of Perl, Tk, Spreadsheet version, and
OS you are using.



--
I'm not really a human, but I play one on earth.
http://www.yqcomputer.com/