Subject: | Curses::UI::Listbox bugs |
Date: | Fri, 27 Aug 2010 02:26:17 +0200 |
To: | bug-curses-ui [...] rt.cpan.org |
From: | Robert Urban <urban [...] unix-beratung.de> |
Hallo,
I've discovered two bugs in Curses-UI-0.9607. For one of them I submit a fix below.
1. the option_check() und option_uncheck() functions should call the
"-onselchange" event handler, if it exists, but they don't. See the
context-diff below.
2. if you scroll pagewise using KEY_NPAGE und KEY_PPAGE, the scrollbar doesn't
get redrawn at the new offset.
cheers,
Robert Urban
-snip-
*** Listbox.pm.ORIG 2010-08-27 01:48:50.469407154 +0200
--- Listbox.pm 2010-08-27 02:15:30.995524227 +0200
***************
*** 592,601 ****
--- 592,602 ----
{
my $changed = ($this->{-selected}->{$this->{-ypos}} ? 0 : 1);
$this->{-selected}->{$this->{-ypos}} = 1;
$this->{-ypos}++;
$this->run_event('-onchange') if $changed;
+ $this->run_event('-onselchange');
$this->schedule_draw(1);
return $this;
} else {
my $changed = (not defined $this->{-selected} or
($this->{-selected} != $this->{-ypos}));
***************
*** 613,622 ****
--- 614,624 ----
{
my $changed = ($this->{-selected}->{$this->{-ypos}} ? 1 : 0);
$this->{-selected}->{$this->{-ypos}} = 0;
$this->run_event('-onchange') if $changed;
$this->{-ypos}++;
+ $this->run_event('-onselchange');
} else {
$this->dobeep;
}
$this->schedule_draw(1);
return $this;
-snip-