Tk::Optionmenu - Let the user select one of some predefined options values
=for category Tk Widget Classes
-options => REFERENCE_to_OPTIONLIST,
$opt->addOptions( OPTIONLIST );
# a) $val1, $val2, $val3,...
# b) [ $lab1=>$val1], [$lab2=>val2], ... ]
# c) combination of a) and b), e.g.,
# val1, [$lab2=>val2], val3, val4, [...], ...
The B<Optionmenu> widget allows the user chose between a given set
If the user should be able to change the available option have a look
(Re)sets the list of options presented.
Defines the L<callback|Tk::callbacks> that is invokes when a new option
Reference to a scalar that contains the current value of the
Adds OPTION_LIST to the already available options.
my $mw = MainWindow->new();
my $opt = $mw->Optionmenu(
-options => [qw(jan feb mar apr)],
-command => sub { print "got: ", shift, "\n" },
$opt->addOptions([may=>5],[jun=>6],[jul=>7],[aug=>8]);
$mw->Label(-textvariable=>\$var, -relief=>'groove')->pack;
$mw->Button(-text=>'Exit', -command=>sub{$mw->destroy})->pack;
L<Tk::Menubutton>, L<Tk::BrowseEntry>