ldln has asked for the wisdom of the Perl Monks concerning the following question:
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('<Button-1>' => sub { print "\nButtonpress - post menu"; my ($x,$y) = ($Tk::event->X,$Tk::event->Y); $menu->post($x,$y); }); $mb->bind('<ButtonRelease>' => sub { print "\nunpost menu."; #no diff #$menu->grabRelease; $menu->unpost(); }); MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: close (unpost) Tk::Menu widget on mousbutton release
by zentara (Cardinal) on Apr 18, 2006 at 19:43 UTC | |
by ldln (Pilgrim) on Apr 18, 2006 at 20:26 UTC | |
by zentara (Cardinal) on Apr 18, 2006 at 21:33 UTC | |
by ldln (Pilgrim) on Apr 19, 2006 at 01:12 UTC | |
by zentara (Cardinal) on Apr 19, 2006 at 11:24 UTC | |
| |
|
Re: close (unpost) Tk::Menu widget on mousbutton release
by injunjoel (Priest) on Apr 18, 2006 at 20:17 UTC | |
by ldln (Pilgrim) on Apr 18, 2006 at 20:37 UTC |