Home > other >  WxPython question: 'MouseEvent object has no attribute' GetPositionTuple '
WxPython question: 'MouseEvent object has no attribute' GetPositionTuple '

Time:11-30

In the learning wxPython, according to https://wizardforcel.gitbooks.io/wxpy-in-action/10.html "initial SketchWindow code example 6.1" writing sample, completely copy the sample, but to run the test, after the left mouse button pressed, the output error: AttributeError: 'MouseEvent object has no attribute' GetPositionTuple,

Excuse me each a great god, and this is what problem, how to solve, thank you!

CodePudding user response:

Problem solved, the original wxpython 4 does not support wx. MouseEvent. GetPositionTuple (), so when get the mouse position, if you want to become a tuple, you need to write: a tuple (wx. MouseEvent. GetPosition ())
  • Related