wxWidgets / Phoenix

wxPython's Project Phoenix. A new implementation of wxPython, better, stronger, faster than he was before.
http://wxpython.org/
2.32k stars 517 forks source link

wxPy 4.1.x MenuItem AttributeErrors #1262

Open Metallicow opened 5 years ago

Metallicow commented 5 years ago

Operating system: Win7 Python version & source: 2.7.16 wxPython 4.1.0a1.dev4146+6dbf2223 msw (phoenix) wxWidgets 3.1.3 Scintilla 3.7.2

Description of the problem: AttributeErrors with wxPython 4.1.x after switching from 4.0.x

AttributeError: 'MenuItem' object has no attribute 'GetLabel'
AttributeError: 'MenuItem' object has no attribute 'GetText'

These are the obvious ones right off the bat. There might be other methods that will cause a traceback also. etc, etc.. See demo or sample apps that use these

Metallicow commented 5 years ago

At quick glance it appears that these changed to

GetItemLabel
GetItemLabelText

and should be updated accordingly thoughout library, demo files etc...

RobinD42 commented 5 years ago

https://docs.wxpython.org/wx.MenuItem.html#wx.MenuItem.GetLabel

They are marked as deprecated in the 4.0 docs. That should have also triggered generating wrapper code that would cause them to issue a deprecation warning at runtime. I'm not sure why they didn't.