UI::Dialog::Backend::Zenity checklist return data is not a list
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libui-dialog-perl (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: libui-dialog-perl
Because of '' instead of "" in
/usr/share/
literally. The responses from Zenity are separated by the
**string** '\n', not by a newline. So, perl fails to split the
answer into an array.
perl -x this message to see the problem.
A Patch is provided below.
sudo apt-get install zenity dialog
#! /usr/bin/perl
print "please, do the same choice for each backend.\n" .
"Select at least 2 item\n\tPress RETURN to start";
my $dum=<STDIN>;
my( $d, %results, @checkSelect );
for my $backend (qw/Zenity XOSD XDialog GDialog KDialog
eval "use UI::Dialog:
\$d=new UI::Dialog:
backtitle => 'Zenity checklist bug demo',
title => $backend );";
if( $@ ) {
print STDERR "skipping backend $backend\n", $@, "\n\n";
next;
}
@checkSelect = $d->checklist(
list => [ 'test', [ 'testing', 1 ],
'b', [ 'beeing', '1' ],
'c', [ 'seeing', '0' ]
]
);
if ($d->state() eq "OK") {
$results{
@checkSelect .
" : '".join("' '",@checkSelect
}
}
for my $r (keys %results) {
printf "%10s : %s\n", $r, $results{$r};
}
__END__
patch for Zenity.pm
--- /usr/share/
+++ UI/Dialog/
@@ -364,7 +364,7 @@
my $command = $self->_mk_cmnd(" --list",$args);
$command .= ($args-
- $command .= ' --separator "\n"';
+ $command .= " --separator '\n'";
#: not quite sure how to implement the editability...
# $command .= ' --editable' unless not $args->
#: --text is not implemented for list widgets, yet...
ProblemType: Bug
Architecture: i386
DistroRelease: Ubuntu 9.04
NonfreeKernelMo
Package: libui-dialog-perl 1.08-1.1
PackageArchitec
ProcEnviron:
LANG=fr_FR.UTF-8
SHELL=/bin/bash
SourcePackage: libui-dialog-perl
Uname: Linux 2.6.28-15-generic i686