Subject: | Web::GUI closes window when appending nodes |
The attached program tries to add a table to the window, but when the
number of rows in the table is above some amount (5 seems ok, 50 does
not), the "window wants to close" dialog comes up. Using IE 8.
Subject: | webguitst.pl |
#!/usr/bin/perl
use strict;
use warnings;
use XUL::Gui;
my $result_cnt = 0;
display
H3('SQL Query'),
(SPAN style => q{
background-color: #222;
outline: 2px solid #444;
padding: 10px;
margin: 10px;
},
(INPUT type => 'button',
value => 'Query',
onclick => sub {
$result_cnt++;
SubmitQuery();
print "Done!\n"
},
),
(INPUT type => 'button',
value => 'Quit',
onclick => sub { print "Quit!\n"; quit() },
),
(BODY id => 'body',
P("Body"),
TABLE( id => "table_$result_cnt", border => 1, TR(TD("#")) ),
),
);
sub SubmitQuery {
my $n_cols = 20;
my $n_rows = 50;
my @columns = (1..$n_cols);
my @results = ([("abcdef") x $n_cols]) x $n_rows;
$ID{body}->appendChild(
TABLE( id => "table_$result_cnt", border => 1,
TR( map { TH($_) } @columns ),
( map {
TR( map { TD($_) } @$_ )
} @results ),
)
);
return 1;
}