#!/usr/local/bin/perl use strict; use warnings; use Tk; use Tk::Pod::Text; our $VERSION = 0.01; my $mainw = MainWindow->new; $mainw->configure(-menu => my $menubar = $mainw->Menu); $menubar->cascade(-label => "~Help", -tearoff => 0, -menuitems =>[ [ command => '~Documentation', -command => \&pod_window ], [ command => '~About', -command => \&about_window ]] ); # ... sub about_window { $mainw->messageBox( -title => 'About', -icon => 'info', -message => "Version $VERSION", -type => 'Ok' ); } sub pod_window { my $hw = $mainw->Toplevel; $hw->Button( -text => 'Close', -command => [$hw => 'destroy'] )->pack( -side => 'bottom' ); $hw->Scrolled( 'PodText', -file => $0, -scrollbars => 'e' )->pack( -side => 'top', -expand => 1, -fill => 'both' ); }