use strict; use Tk; my $mw = tkinit; my $mb = $mw->Menubutton(-text=>'menubutton', )->pack; my $menu = $mb->Menu ( -tearoff=>0, -menuitems => [ ['command',' item', ] ] ); #no diff #$menu->bindtags(undef); $mb->bind('' => sub { print "\nButtonpress - post menu"; my ($x,$y) = ($Tk::event->X,$Tk::event->Y); $menu->post($x,$y); }); $mb->bind('' => sub { print "\nunpost menu."; #no diff #$menu->grabRelease; $menu->unpost(); }); MainLoop;