A recent update (Python 3.11? wxWidgets 3.2.2? sip 6.7.4? ) breaks “MenuItem” on MSW.
A colleague (MSW) and I (Linux GTK) just compiled from source the latest wxPython and included wxWidgets from the master branch.
On MSW something is broken because we get this error when trying to run the demo.
PS C:\Users\myuser\Phoenix\demo> python .\demo.py
Traceback (most recent call last):
File "C:\Program Files\MyApp\WPy64-31120b3\python-3.11.2.amd64\Lib\site-packages\wx\core.py", line 2346, in Notify
self.notify()
File "C:\Program Files\MyApp\WPy64-31120b3\python-3.11.2.amd64\Lib\site-packages\wx\core.py", line 3552, in Notify
self.result = self.callable(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "Z:\Phoenix\demo\Main.py", line 2605, in ShowMain
frame = wxPythonDemo(None, "wxPython: (A Demonstration)")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "Z:\Phoenix\demo\Main.py", line 1497, in __init__
self.BuildMenuBar()
File "Z:\Phoenix\demo\Main.py", line 1664, in BuildMenuBar
exitItem = wx.MenuItem(menu, wx.ID_EXIT, 'E&xit\tCtrl-Q', 'Get the heck outta here!')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: MenuItem(): argument 2 has unexpected type 'StandardID'
On Linux GTK things work as expected. We are both using Python 3.11.2.
My colleague has experience compiling wxPython/wxWidgets from source on MSW so the broken demo suggests that something has changed.
We welcome any thoughts. Thank you.