thus:
#!/usr/bin/perl use Term::ANSIMenu; my $menu = Term::ANSIMenu->new( width => 40, help => [['', \&standard_help], ['hint 1', \&help_item], [ undef, \&standard_help], ['hint 3', undef] ], title => 'title', items => [['1', 'First menu item', \&exec_item], ['2', 'This string is just too long to fit in a normal t +erminal and thus it will be clipped.'], ['3', '', sub { system "man man" }] ], status => 'status', prompt => 'prompt: ' ); $menu->selection_fgcolor("RED"); $menu->print_menu(); while (my $key = $menu->read_key()) { last unless defined $menu->do_key($key); $menu->update_status('') if $key eq 'S'; $menu->update_status('New status') if $key eq 's'; $menu->update_prompt('') if $key eq 'P'; $menu->update_prompt('New prompt: ') if $key eq 'p'; } $menu->pos($menu->line_after_menu() + 1, 1);
The documentation is pretty clear:
Attributes can be accessed by using a method that will function as both a accessor and a mutator.
Thus you can read it like this: $thefgcolor = $menu->selection_fgcolor();
Its value can be changed like this:
$menu->selection_fgcolor($newfgcolor);
edit: tabs to spaces: A bit less indentation...
In reply to Re: Term::ANSIMenu help
by FreeBeerReekingMonk
in thread Term::ANSIMenu help
by PerlTwo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |