I gave it a try making my own menu class from wx.Menu and bind wx.EVT_MENU to it but I can’t seem to get the selected menuitem when I select one of the radioitems… wxEVT_COMMAND_MENU_SELECTED doesn’t work (isn’t it basically the wx.EVT_MENU commandEvent?) … when I bind that event to a menu I get this error:
Traceback (most recent call last):
File “/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_wx.py”, line 1242, in _onRightButtonUp
FigureCanvasBase.button_release_event(self, x, y, 3, guiEvent=evt)
File “/usr/lib64/python2.6/site-packages/matplotlib/backend_bases.py”, line 1219, in button_release_event
self.callbacks.process(s, event)
File “/usr/lib64/python2.6/site-packages/matplotlib/cbook.py”, line 163, in process
func(*args, **kwargs)
File “/home/specuser/workspace/bioxtasraw/RAW.py”, line 1301, in OnMouseButton
self.ShowPopupMenu()
File “/home/specuser/workspace/bioxtasraw/RAW.py”, line 1318, in ShowPopupMenu
firstSubMenu.Bind(wx.wxEVT_COMMAND_MENU_SELECTED, self.OnMenuItemSelection)
File “/usr/lib64/python2.6/site-packages/wx-2.8-gtk2-unicode/wx/_core.py”, line 3918, in Bind
event.Bind(self, id, id2, handler)
AttributeError: ‘int’ object has no attribute ‘Bind’
I think I’m on the right track, but I just need to be able to extract the selected radioitem when I click on it.
Soren
···
On Sat, Jul 17, 2010 at 3:05 AM, GadgetSteve@live.co.uk wrote
I would guess all you need to do is to have an wxEVT_COMMAND_MENU_SELECTED handler for all your radio items that deselect all the others for you - i.e. you will have to handle the radio group bit yourself.
Gadget/Steve
–
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en
–
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en