开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜