|
From: Marcus <ma...@wo...> - 2002-07-30 15:41:54
|
>This works for me (added to minimal sample).
>... EVT_MENU( $this, 124, sub {
#$mhelp->Destroy(($mhelp->GetMenuItems)[-1]); # this one works too
$mhelp->Destroy( 1 );
} );
Ah, using it inside the create menubar sub works, otherwise it doesn't because you lose the handle on the menu. So, the answer was to copy the handle and make it accessable from other subs.
(Mattia) Can you explain why the handle (scalar) for the menu changes, but not the handle for the menu bar?
using this code:
my ($mbar) = &main::MyMenuBarFunc();
print "mbar:$mbar\n";
my ($mfile) = $mbar->GetMenu(0);
print "mfile:$mfile\n";
The latter changes later on, although mbar is the same.
2)
>Oops, in Wx/Event.pm, replace wxEVT_COMMAND_MENU_RANGE
>with wxEVT_COMMAND_MENU_SELECTED
Thanks, that works now :-)
Marcus
|