There isn't a built-in way. You will need to build an event dictionary. Robin Dunn has some code here that will help: http://osdir.com/ml/wxpython-users/2009-11/msg00138.html
Or you can check out my simple example:
import wx
class MyForm(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, title="Tutorial")
self.eventDict = {}
for name in dir(wx):
if name.startswith('EVT_'):
evt = getattr(wx, name)
if isinstance(evt, wx.PyEventBinder):
self.eventDict[evt.typeId] = name
# Add a panel so it looks the correct on all platforms
panel = wx.Panel(self, wx.ID_ANY)
btn = wx.Button(panel, wx.ID_ANY, "Get POS")
btn.Bind(wx.EVT_BUTTON, self.onEvent)
panel.Bind(wx.EVT_LEFT_DCLICK, self.onEvent)
panel.Bind(wx.EVT_RIGHT_DOWN, self.onEvent)
def onEvent(self, event):
"""
Print out what event was fired
"""
evt_id = event.GetEventType()
print self.eventDict[evt_id]
# Run the program
if __name__ == "__main__":
app = wx.App(False)
frame = MyForm().Show()
app.MainLoop()