use strict; use warnings; use Tk; my $repo_filepath = "some current repo path?"; my $STD_TITLE = 'the title of this application'; # --- generate the "main" window my $mw = MainWindow->new; $mw->configure(-title=> $STD_TITLE); $mw->geometry("400x100+0+0"); # appears in upper left corner of screen # --- make a menu frame within the main frame # A common mistake is not make enough frames when using pack(). # Basically, make a frame for everything that has more than # one Tk object in it. With pack(), more frames ==>> good! my $menu_f = $mw->Frame()->pack(-side=>'top',-fill=>'x'); # --- populate top level menu buttons in the menu frame my $menu_file = $menu_f->Menubutton (-text=>'File',-tearoff=>'false') ->pack(-side=>'left'); my $menu_configure = $menu_f->Menubutton (-text=>'Configure',-tearoff=>'false') ->pack(-side=>'left'); my $menu_help = $menu_f->Menubutton (-text=>'Help',-tearoff=>'false') ->pack(-side=>'left'); my $label_repo_path = $menu_f->Label # maybe display current repo path? # in main window of the application? (-textvariable => \$repo_filepath) ->pack(-side=>'right'); #---- "Configure" Button options only --- #---- The menu buttons for 'File' and 'Help' will do nothing at all! $menu_configure->command (-label=>'Option A', -command => \¬_implemented ); #--- the "Repo" option has a cascade of menu options my $repo_level2 = $menu_configure->cascade( -label => 'Repo', -tearoff=>'false'); $repo_level2->command(-label => "Valdidate Repo", -command => \¬_implemented ); $repo_level2->command(-label => "Change Repo PathName", -command => \¬_implemented ); $repo_level2->command(-label => "Back up Repo", -command => \¬_implemented ); # continuing with other 'Config' options ..... $menu_configure->command (-label=>'Option C', -command => \¬_implemented ); #--- end of menu options MainLoop(); sub not_implemented { my $response = $mw->messageBox( -title => $STD_TITLE, -message => "You wish this feature worked!! Sorry!!!\n\n", -type => 'Ok'); }