Intercept and modify MouseEvents?

In wxPython2.8 I was able to modify MouseEvents.
This would change the MouseEvent’s x,y position to parent coordinates and allow them to propagate to the parent.

def OnClick(self, event):
    screen = self.ClientToScreenXY(*event.GetPositionTuple())
    event.m_x, event.m_y = self.parent.ScreenToClient(screen)
    event.SetEventObject(self.parent)
    event.ResumePropagation(1)
    event.Skip()

In wxPython 3.0 this raises a wxPyDeprecationWarning: Accessing deprecated property.
If I change the line to:
event.X, event.Y = self.parent.ScreenToClient(screen)
Then it works fine, but this doesn’t work at all under wxPython2.8 (unable to set property).

Is there a better way to do this? Something that would work under all wxPython versions?

do you actually have customers demanding "backwards compatibility" ?

Else just progam against "Phoenix".

Hi,

If you can use only Phoenix, that's great, but if you want to support both
Classic and Phoenix for now, while Phoenix is still in alpha, you can run
different code for Classic and Phoenix, like this:

if 'phoenix' in wx.PlatformInfo:
    event.X, event.Y = self.parent.ScreenToClient(screen)
else:
    event.m_x, event.m_y = self.parent.ScreenToClient(screen)

Disclaimer: I'm not familiar with the ScreenToClient method - I'm only
commenting on the desire to have your code run against both Classic and
Phoenix without deprecation warnings.

Cheers,
James