in reply to How to remove items from a cascade menu in Tk?
use Tk; my $main = tkinit; my $menubar = $main->Menu(-type => 'menubar'); $main->configure(-menu => $menubar); my $menu_links = $menubar->cascade(-label => "Links", -tearoff => 0); $menu_links->command(-label => "Kill'em all", -command => sub{ $menu_links->menu->delete(2,5); }); $menu_links->separator(''); $menu_links->command(-label => 'test1', -command => \&sub1); $menu_links->command(-label => 'test2', -command => \&sub2); $menu_links->command(-label => 'test3', -command => \&sub3); MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to remove items from a cascade menu in Tk?
by Jester_yang (Initiate) on Jul 07, 2004 at 08:04 UTC |