Folks,
I'm making a simple UI for a networked utility and have found the
following. Since I'm using a listbox, this is how I found how
about this. I haven't done any other testing, nor did I have
looked at any POE code. I have the utility to do and that takes
my time.
The problem is about key presses. If you start the demo-widgets
with the list demo (window number 5) and if you immediately press
the down arrow key, there'll be a out-of-sequence situation that
has the net result of making the UI unusable.
Now, if you start the same list demo directly (see below) and
instead of pressing a down arrow as the first key, you press the
space bar (or any other plain key - as opposed to extended), then
everthing is OK.
To start the demo directly in the list demo add the following:
$current_demo = 5;
before:
$w{$current_demo}->focus;
Near the end of the file.
Another way of demoin the problem just by comparing between using
Curses::UI and Curses::UI::POE:
# -------------------------------------------
#!/usr/bin/perl
use warnings;
use strict;
use Curses::UI::POE;
my $cui = new Curses::UI;
#my $cui = new Curses::UI::POE;
my $win = $cui->add('window_id', 'Window');
my $listbox = $win->add
(
'mylistbox', 'Listbox',
-values => [1, 2, 3],
-labels => { 1 => 'One',
2 => 'Two',
3 => 'Three' },
-radio => 1,
);
$win->focus();
# <CTRL+Q> : quit.
$cui->set_binding( sub{ exit }, "\cQ" );
$cui->mainloop();
# -------------------------------------------
System: Fedora Core 6
Perl: 5.8.8
POE: 0.9917
The rest: got from CPAN today.
Is this a system (eg. inputrc) problem or a real bug ?
Thanks !
Al.