Subject: | Bug in Curses::UI::POE |
Date: | Sun, 18 Feb 2007 08:33:23 -0500 |
To: | bug-curses-ui-poe [...] rt.cpan.org |
From: | lanas <lanas [...] securenet.net> |
Hello,
Here is a bug that I found. I've never used this RT system so I hope
this e-mail is OK.
In brief, pressing any arrow key as the first keypress after
the app (see below) starts confuses the UI.
The test is made with either:
my $cui = new Curses::UI;
or:
my $cui = new Curses::UI::POE;
# ----------------------------------------------------
Procedure:
(1)
my $cui = new Curses::UI;
#my $cui = new Curses::UI::POE;
Launch the app, and immediately press the down arrow.
The UI will be all right and usable.
(2)
#my $cui = new Curses::UI;
my $cui = new Curses::UI::POE;
(2a)
Launch the app, and immediately press the down arrow.
The UI will be out of sync and unusable.
(2b)
Launch the app, and immediately press any key such as 'q', spacebar,
Ctrl-N, ENTER, etc... but NOT any of the arrow keys.
THEN press any arrow key to move in the menu.
The UI will be all right and usable.
# ----------------------------------------------------
Pressing any arrow key as the first keypress confuses the app when
Curses::UI::POE is used and makes the UI unusable.
For the time being I'm using a trick so that users can use the app
without moticing anything: I ask them to press ENTER to make a
network conenction, so ENTER becomes the very first keypress.
Code
# ----------------------------------------------------
#!/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();
# ----------------------------------------------------
Cheers,
Al