use strict; use Win32::GUI (); $|=1; my $window = Win32::GUI::Window->new(); my $menu = new Win32::GUI::Menu( "mymenu" => "mymenu", " > foo" => "foo", " > bar" => { -name => 'bar', -onClick => \&bar_onclickcallback }, ); print "Start Tracking\n"; $window->TrackPopupMenu($menu->{mymenu}, 20,20); print "Done Tracking, if it didn't print 'GOTCHA ...' then no callback?\n"; sub bar_onclickcallback { print "GOTCHA bar\n"; return 1; } sub foo_Click { print "GOTCHA foo\n"; return 1; } #### This is perl, v5.10.1 built for MSWin32-x86-multi-thread (with 2 registered patches, see perl -V for more detail) Copyright 1987-2009, Larry Wall Binary build 1007 [291969] provided by ActiveState http://www.ActiveState.com Built Jan 26 2010 23:15:11