p1ato has asked for the wisdom of the Perl Monks concerning the following question:
Notice that while the second TrackPopupMenu call is commented, the subroutine for the menu is not called. Uncomment the second call to $window->TrackPopupMenu(...) to see how the second call will trigger the subroutine that should have executed immediately after the first call. Adding in SetForegroundWindow/PostMessage doesn't help. If someone knows how to make the subroutine get called without a second call to TrackPopupMenu I would appreciate it. Thanks!use Win32::GUI (); my $window = Win32::GUI::Window->new(); my $menu = Win32::GUI::Menu->new(-name => "TestMenu"); $menu->{"TestMenu"}->AddMenuItem( -item => 0, -id => 14, -text => "Exit", -name => "randomName", -onClick => sub { exit; }, ); #$window->SetForegroundWindow(); $window->TrackPopupMenu($menu->{"TestMenu"}, 20, 20); #$window->PostMessage("Msg", 0, 0); #$window->TrackPopupMenu(Win32::GUI::Menu->new(-name => "dummyMenu"), +20, 20); while (1) { sleep(1); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: TrackPopupMenu delay
by Anonymous Monk on Aug 19, 2008 at 04:34 UTC | |
by p1ato (Initiate) on Aug 19, 2008 at 12:55 UTC | |
by Anonymous Monk on Oct 08, 2008 at 15:49 UTC | |
|
Re: TrackPopupMenu delay
by Anonymous Monk on Aug 19, 2008 at 04:52 UTC | |
by p1ato (Initiate) on Aug 19, 2008 at 12:48 UTC | |
|
Re: TrackPopupMenu delay
by Anonymous Monk on Oct 08, 2008 at 15:56 UTC |