user_katie has asked for the wisdom of the Perl Monks concerning the following question:
I want to be able to display a set of options in a dropdown menu and want to call a subroutine whenever the user selects an option from it.
here is how my current code looks like:I get a compilation error as follows:@vars = ("a1", "b2", "c3"); $opt = $w1->Optionmenu(-options=>\@vars, -variable=>\$tvars -command=> sub { print "got : ", shift, "\n"})->pac +k;
anyone had any experience similar to this?Tk::Error: Odd number of args to Tk::Optionmenu->new(...)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Error with perl tk::OptionMenu
by shmem (Chancellor) on Sep 03, 2008 at 21:53 UTC | |
by user_katie (Initiate) on Sep 04, 2008 at 17:51 UTC |