wxPython get event ID
I have some code, which binds a menu item to a method:
def getEventID(self, event):
print id # how do I get id?
EVT_MENU(self, 123, self.getEventID)
So basicly,开发者_运维问答 I want my app to print "123" when the menu item with that ID is pressed. How would I do that?
You should just be able to use event.GetId()
I believe. You can also use event.GetEventObject()
to get the widget that fired the event.
精彩评论