Re: Curses::UI: No definition found for "< Yes >"

Re: Curses::UI: No definition found for "< Yes >"

am 11.07.2006 09:19:14 von mumia.w.18.spam+nospam.usenet

Chasecreek Systemhouse wrote:
> On 7/10/06, Mumia W. wrote:
>> I'm trying to learn to use Curses::UI, and I read the top of "perldoc
>> Curses::UI" and found some example code. Unfortunately, it doesn't work.
>> This is my program:
>>
>> #!/usr/bin/perl
>>
>> use strict;
>> use warnings;
>> use Curses::UI;
>>
>> my $cui = new Curses::UI (-color_support => 1);
>> my $my = $cui->dialog(
>> -message => 'Hello World.',
>> -buttons => ['< Yes >', '< No >'],
>> -values => [1, 0],
>> -title => 'First Dialog',
>> );
>>
>> __END__
>>
>> When I run this program, I get this error message:
>>
>>> > Fatal program error:
>>> > ------------------------------------------
>>> > process_buttondefs(): Invalid button type.
>>> > No definition found for '< Yes >'
>>> > ------------------------------------------
>>> > Press any key to exit...
>>
>
> The Curses::UI refers you to a more appropriate example. The example's syntax:
>
> use FindBin;
> use lib "$FindBin::RealBin/../lib";
>
> use strict;
> use Curses::UI;
> [...]
>
> In other words, the < Yes > was supposed to be the label of a button;
> not a button itself...
>
> HTH/Sx

Thanks. I wanted something simple to start with, and after reading
Curses::UI::Buttonbox's doc page, I created a simple example that works:

#!/usr/bin/perl

use strict;
use warnings;
use Curses::UI;

my $cui = new Curses::UI (-color_support => 1);

my $my = $cui->dialog(
-message => 'Hello World.',
-buttons => ['yes', 'no'],
-values => [1, 0],
-title => 'First Dialog',
);

__END__

'Yes' and 'no' are pre-defined button names. Perhaps the example code in
Curses::UI should be changed.

Re: Curses::UI: No definition found for "< Yes >"

am 11.07.2006 11:37:01 von mumia.w.18.spam+nospam.usenet

Mumia W. wrote:
> [...] I created a simple example that works:
>
> #!/usr/bin/perl
>
> use strict;
> use warnings;
> use Curses::UI;
>
> my $cui = new Curses::UI (-color_support => 1);
>
> my $my = $cui->dialog(
> -message => 'Hello World.',
> -buttons => ['yes', 'no'],
> -values => [1, 0],
> -title => 'First Dialog',
> );
>
> __END__
>
> 'Yes' and 'no' are pre-defined button names. Perhaps the example code in
> Curses::UI should be changed.
>
>

I mean, perhaps the documentation in Curses::UI should
be changed.