Khariton has asked for the wisdom of the Perl Monks concerning the following question:
In some place of code I need delete all menu items(created by method 'command') and create new menu items.my $TOP=Tk::MainWindow->new; my $tp=$TOP->Toplevel; $tmb=$tp->MenuButton(-text=>'',-tearoff=>0)->pack; foreach my $d (@dir) { $tmb->command(-label=>decode('utf8',$d),-command=>sub { ... }) };
After this code I have deleted all menu items. But -tearoff=>0 now not working(I see line in menubutton menu) and if I use this parameter then I have error like "this is wrong parameter".$tmb->configure(-menu=>'');
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: delete menu items im Tk::MenuButton
by zentara (Cardinal) on Dec 05, 2010 at 20:01 UTC | |
by Khariton (Sexton) on Dec 06, 2010 at 06:34 UTC | |
by Khariton (Sexton) on Dec 06, 2010 at 08:46 UTC |