def __init__(self):
wx.Frame.__init__(self, None, title="Tutorial")
self.eventDict = {}
evt_names = [x for x in dir(wx) if x.startswith("EVT_")]
for name in evt_names:
evt = getattr(wx, name)
if isinstance(evt, wx.PyEventBinder):
self.eventDict[evt.typeId] = name
grid_evt_names = [x for x in dir(wx.grid) if x.startswith("EVT_")]
for name in grid_evt_names:
evt = getattr(wx.grid, name)
if isinstance(evt, wx.PyEventBinder):
self.eventDict[evt.typeId] = name
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)