Bug#434646: libcurses-ui-perl: toogle destroys boolean value of Checkbox

Niko Tyni ntyni at iki.fi
Wed Jul 25 18:26:36 UTC 2007


severity 434646 normal
clone 434646 -1
retitle -1 libcurses-ui-perl: Curses::UI::Checkbox documentation copy-paste error
severity -1 minor
thanks

On Wed, Jul 25, 2007 at 04:30:30PM +0200, Willi Mann wrote:
> Package: libcurses-ui-perl
> Version: 0.95-6
> Severity: important
> 
> Function toogle in Checkbox.pm:
> 
> sub toggle()
> {
> 	my $this = shift;
> 	$this->{-checked} = !$this->{-checked};
> 	$this->run_event('-onchange');
> 	$this->schedule_draw(1);
> }
> 
> Unfortunatly, when the state was 1 and toogle was called, the state was
> an empty string afterwards.

This is indeed contrary to the documentation of the 'get' method,
which states:

 This method will return the current state of the checkbox (0 = not
 checked, 1 = checked).

The empty string is still false, though, and will turn back to 1
if re-toggled, so there isn't really any information lost. I think
'important' is an overrated severity here.

That said, I don't see any problem with applying your fix. The uncheck()
method "correctly" sets $this->{-checked} to 0, so people can't really
be relying on the empty string behaviour.

> BTW: The hierarchy is wrong in Checkbox.pm, it lists Buttonbox instead
> of Checkbox.

Right, I'm cloning another (minor) bug for this.

Thanks for reporting these issues.

Cheers,
-- 
Niko Tyni   ntyni at iki.fi




More information about the pkg-perl-maintainers mailing list