From: Mattia B. <mb...@ds...> - 2002-08-11 08:29:52
|
> I've asked this first > at > http://perlmonks.com/index.pl?node_id=189173 > this morning (early early early early) > After seeing that Vacation notice, I decided to post here as well > (i was gonna wait a day or two to see if anybody responds) > Anyway, here goes, HEEEEEEEELP! ;) > > In wxPerl, if i use EVT_MENU($this, 123, sub{warn 1} ); to essentially "bind" > that anon-sub to the 123 id, how do I go about unbinding it (is that even the > right terminology)? > > I've tried EVT_MENU($this, 123, sub{warn 2} ); EVT_MENU($this, 123, undef ); > which doesn't work. Probably it should (because it DWIMs, and it is easier than what is below). For now: $frame->Disconnect( 123, -1, &Wx::wxEVT_COMMAND_MENU_SELECTED ); If you need to disconnect other events, just look in lib/Wx/Event.pm for the definition, replace ->Connect with ->Disconnect and remove the last argument (the code reference). > Is it even possible? (i suspect it's not, but I can't be sure) It is :-) HTH Mattia |