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?