#!/bin/env perl -w use Tk; use Tk::Menu; use Encode::Unicode; use strict; my $exit_val = 0; my $menubar; my $menuitems; my $top; my %code = ( 60 => "Contactor Repair | \x{4FEE}\x{593E}\x{8173}", 120 => "Change Cleaning Disk | \x{66F4}\x{63DB}\x{786C}\x{789F}", 180 => "Change Loadboard | \x{66F4}\x{63DB}\x{6E2C}\x{8A66}\x{677F}", 240 => "Change LN2 | \x{66F4}\x{63DB}\x{6DB2}\x{614B}\x{6C2E}", ); #----- Main ---------------------------- $top = new MainWindow; $top -> title ("Select"); $top -> geometry ("200x50+10+10"); $menuitems = [ [Cascade => "SELECT", -menuitems => [ [ Button => "$code{ 60}", -font => "courier", -command => [\&exit_r, 60] ], [ Button => "$code{120}", -font => "courier", -command => [\&exit_r, 120] ], [ Button => "$code{180}", -font => "courier", -command => [\&exit_r, 180] ], [ Button => "$code{240}", -font => "courier", -command => [\&exit_r, 240] ], ] ], ]; # end menuitems $menubar = $top->Menu (-menuitems => $menuitems); $top->configure(-menu => $menubar); MainLoop; exit ($exit_val); sub exit_r { $exit_val = shift; $top -> destroy; }