Phoenix FlatMenu Crash On OpenMenu Issue

Finally found what was crashing the flatmenus/demo with phoenix. I’m not sure what should be done about it…

in wx/lib/agw/flatmenu.py …
def Popup(self, pt, owner=None, parent=None):

#-----CRASHING HERE PHOENIX---------------------------------------------
# Replace the event handler of the active window to direct
# all keyboard events to us and the focused window to direct char events to us
## self._activeWin = wx.GetActiveWindow()
## if self._activeWin:
##
## oldHandler = self._activeWin.GetEventHandler()
## newEvtHandler = MenuKbdRedirector(self, oldHandler)
## self._activeWin.PushEventHandler(newEvtHandler)
#-----------------------------------------------------------------------

Any Ideas on how to fix it or is commenting out this section fine…?

Metallicow wrote:

Finally found what was crashing the flatmenus/demo with phoenix. I'm not
sure what should be done about it...

in wx/lib/agw/flatmenu.py ...
def Popup(self, pt, owner=None, parent=None):
...

    #-----CRASHING HERE PHOENIX---------------------------------------------
    # Replace the event handler of the active window to direct
    # all keyboard events to us and the focused window to direct char
    events to us
    ## self._activeWin = wx.GetActiveWindow()
    ## if self._activeWin:
    ##
    ## oldHandler = self._activeWin.GetEventHandler()
    ## newEvtHandler = MenuKbdRedirector(self, oldHandler)
    ## self._activeWin.PushEventHandler(newEvtHandler)
    #-----------------------------------------------------------------------

Any Ideas on how to fix it or is commenting out this section fine...?

It looks like Phoenix is not doing anything yet about the ownership transfer of the wx.EvtHandler that needs to take place. It would normally be easy to add but PopEvtHandler will optionally destroy the handler for you, so I'll need to do something a little tricky there.

···

--
Robin Dunn
Software Craftsman