#!/usr/bin/perl -w use strict; use Tk; #file tkdemo.pl 11 aug 2009 # $mw is normally the variable name for "MainWindow" my $mw = MainWindow->new; $mw->configure(-title=> "Hacking..."); $mw->geometry("400x100+0+0"); my $menu_f = $mw->Frame()->pack(-side=>'top',-fill=>'x'); my $menu_file = $menu_f->Menubutton (-text=>'File',-tearoff=>'false') ->pack(-side=>'left'); my $menu_help = $menu_f->Menubutton (-text=>'Help', -tearoff=>'false', )->pack(-side=>'left'); $menu_file->command(-label=>'Open', -command=> \&you_wish); $menu_help->command(-label=>'Help??!!!', -command=> \&you_wish); sub you_wish { $mw->messageBox ( -title => "Hacking...", -message => "You wished that this option worked!!!", -type => 'Ok' ); } #This starts the GUI "waiting for event loop" MainLoop();