w3ntp has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/local/bin/perl # ABSTRACT: Perl Shell script to create menu widgets # # use Tk; # # Start the Main program # print "Menu Shortcut Server Ver 1.0, working....\n"; $mw = MainWindow -> new; $mw -> title("NOCMAN Workstation"); $mw -> Frame( -width => 300, -height => 18) -> pack; $mw -> configure( -menu => my $menubar = $mw -> Menu); my $file = $menubar -> cascade(-label => '~File'); my $edit = $menubar -> cascade(-label => '~Edit'); $new = $file ->cascade( -label => 'New'); $new ->command( -label => 'new stuff'); $new ->command( -label => 'more stuff'); $new ->command( -label => 'other stuff'); $file ->command( -label => 'Open'); $file ->command( -label => 'Save'); $file ->command( -label => 'Save as..'); $file ->command( -label => 'Close', -command => \&exit); $edit ->command( -label => 'Open'); $edit ->command( -label => 'Save'); $edit ->command( -label => 'Save as..'); $edit ->command( -label => 'Close', -command => \&exit); MainLoop; exit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to implement a cascading Menu
by PodMaster (Abbot) on May 11, 2005 at 07:03 UTC | |
by w3ntp (Beadle) on May 11, 2005 at 13:33 UTC | |
|
Re: How to implement a cascading Menu
by zentara (Cardinal) on May 11, 2005 at 10:47 UTC |