in reply to delete menu items im Tk::MenuButton
#!/usr/bin/perl use warnings; use strict; use Tk; my $mw = MainWindow->new(); my @opt1 = ('a'..'m'); my $var = 'a'; my $tvar = 'a'; my $opt = $mw->Optionmenu( -command => \&show_choice, -variable => \$var, -textvariable => \$tvar, -options => \@opt1, )->pack; $mw->Button(-text=>'Change Options',-command=>[\&change_ops, $opt])->p +ack; $mw->Button(-text=>'Exit', -command=>sub{$mw->destroy})->pack; MainLoop; sub show_choice { print "got: ", shift, "\n" } sub change_ops { my $op = shift; my @newoptions =(); $tvar = 'null'; $op->configure( -options => \@newoptions ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: delete menu items im Tk::MenuButton
by Khariton (Sexton) on Dec 06, 2010 at 06:34 UTC | |
by Khariton (Sexton) on Dec 06, 2010 at 08:46 UTC |