sub menbut { my($TOP) = @_; my $menubutton = $TOP->Menubutton(qw/-underline 0 -relief raised/, -text => 'SELECT', -direction => 'above'); my $menu = $menubutton->menu(qw/-tearoff 0/); $menubutton->configure(-menu => $menu); $menubutton->command(-label => "menu: first item", -command => sub {print "You selected the first item from the $pos menu.\n"}); $menubutton->command(-label => "menu: second item", -command => sub {print "You selected the second item from the $pos menu.\n"}); $menubuttons->pack(); }