I am running into an interesting issue on a program I was asked to look at where using standard accelerator keys to navigate a menu created using wx.lib.agw.flatmenu causes problems. I haven’t been able to test this rigorously however it has only happened when a menu item as the number 2 assigned as an accelerator on Windows 7-64bit, with Python 2.7 and wxPython 2.9.5 installed. Here is the traceback from the error.
python accel_test.py
[‘Menu Item: Test 1, 101’, ‘Menu Item: Test 2, 102’, ‘Menu Item: Test 3, 103’,
Menu Item: Test 4, 104’]
101
Traceback (most recent call last):
File “accel_test.py”, line 46, in onMenuClick
print evt.GetEventObject().FindItem(evt.GetId()).GetLabel()
AttributeError: ‘MainFrame’ object has no attribute ‘FindItem’
To me it appears that 2 is being used by the frame as an accelerator, but it doesn’t quite make sense as to why or how that could happen. Has anyone else run into this or similar errors and been able to resolve it easily?
accel_test.py (1.94 KB)