Re: SimpleList questions from a beginner
- From: "Ross McFarland" <rwmcfa1 neces com>
- To: Bjarne Steinsbø <bosteins broadpark no>
- Cc: gtk-perl-list gnome org
- Subject: Re: SimpleList questions from a beginner
- Date: Tue, 30 Sep 2003 16:18:25 -0400 (EDT)
Bjarne Steinsbø said:
What I did was to add another button (called it "Many"), since I wanted
to test the performance of this widget when handling large amounts of
data. Adding the button was just a question of adding it to the list of
buttons to make. In "btn_clicked" I then added a case to the switch for
my new button "Many". I first tried the code
i have now done the same.
...
elsif( $op eq 'Many' )
{
my @more;
for (my $i = 0; $i < 10000; $i++)
{
push @more, [
'many', $i, $i + $i/100, 1, 'many', undef, 'many', []
];
}
push @{$slist->{data}}, @more;
}
...
should be perfectly legal, and will be.
This is probably closest to the way I want to add data to the model,
i.e. the data already prepared in an array for adding, and then added to
the model in one go. At the time I hadn't looked at the implementation
of the SimpleList, so I also thought that this would have a better
performance than adding the data one row at a time. I know see that it
doesn't really matter that much.
However, it didn't work as expected. Only one row (the first one) was
added to the model. I had expected the call signature of the "push"
function to be honored, but it's not. From the "SimpleList.pm". the
problem seems to be in the PUSH (and SHIFT) function in ...::TiedList.
It's not expecting more than one parameter in addtion to the object
itself. This making any sense to you?
good spot, that was the problem. what's worse is that i ran into it the other
night playing around but got interuped before i dug into it and never went
back to play with what i was then.
It is of course no big deal to change the code to add the data one row
at the time.
shouldn't be nec, and in the future will not be.
changes/fixes will be commited to cvs pretty soon, i need to do a little
thinking, verification, and testing first. it will be included in any further
releases.
that was both muppet's and my first expirence with tie'ing so we didn't really
have a clue what was going on in the begining, which may be evident to people
who do.
-rm
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]