开发者

wxPython get event ID

开发者 https://www.devze.com 2023-03-22 01:52 出处:网络
I have some code, which binds a menu item to a method: def getEventID(self, event): print id # how do I get 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

精彩评论

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