Chasecreek Systemhouse wrote:
> On 7/10/06, Mumia W. <[EMAIL PROTECTED]> 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.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to