CC: | prima [...] prima.eu.org |
Subject: | Is it bug in Prima::Notebooks? |
Date: | Sat, 3 Apr 2010 00:00:35 +0200 |
To: | bug-Prima [...] rt.cpan.org |
From: | Waldemar Biernacki <wb [...] sao.pl> |
Prima is really very good. Thank you Dmitry and other authors!
I found some problem with the module Prima::Notebooks.:
there in the module Prima::Notebooks is a function "move_widget", which in
fact results in removing all existing widgets in a notebook page and saving
only the last widget. I think the result should be simple to add additional
widgets to the page.
Details:
sub move_widget
{
my ( $self, $widget, $newPage) = @_;
my ( $page, $number) = $self-> contains_widget( $widget);
return unless defined $page;
@{$self-> {widgets}-> [$newPage]} = splice( @{$self-> {widgets}-> [$page]},
$number, 1);
$self-> repaint if $self-> {pageIndex} == $page || $self-> {pageIndex} ==
$newPage;
}
but I think it should be as follows:
sub move_widget
{
my ( $self, $widget, $newPage) = @_;
my ( $page, $number) = $self-> contains_widget( $widget);
return unless defined $page;
###################### instead lines:
# @{$self-> {widgets}-> [$newPage]} =
# splice( @{$self-> {widgets}-> [$page]}, $number, 1);
###################### should be these lines:
my @prev_widgets = @{$self-> {widgets}-> [$newPage]};
@{$self-> {widgets}-> [$newPage]} =
( @prev_widgets, splice( @{$self-> {widgets}-> [$page]}, $number, 1));
##################################################
$self-> repaint if $self-> {pageIndex} == $page || $self-> {pageIndex} ==
$newPage;
}
There should be also revisted remain functions in the module.
My system:
# Prima 1.28
# perl -v
This is perl, v5.10.1 (*) built for x86_64-linux-gnu-thread-multi
(with 40 registered patches, see perl -V for more detail)
Copyright 1987-2009, Larry Wall
# uname -a
Linux borsuk 2.6.32-2-amd64 #1 SMP Fri Feb 12 00:01:47 UTC 2010 x86_64
GNU/Linux
Regards!
Waldemar Biernacki