]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/samples/wxPIA_book/Chapter-03/menu_event.py
5 class MenuEventFrame(wx
.Frame
):
7 def __init__(self
, parent
, id):
8 wx
.Frame
.__init
__(self
, parent
, id, 'Menus', size
=(300, 200))
11 menuItem
= menu1
.Append(-1, "&Exit...")
12 menuBar
.Append(menu1
, "&File")
13 self
.SetMenuBar(menuBar
)
14 self
.Bind(wx
.EVT_MENU
, self
.OnCloseMe
, menuItem
)
16 def OnCloseMe(self
, event
):
19 if __name__
== '__main__':
20 app
= wx
.PySimpleApp()
21 frame
= MenuEventFrame(parent
=None, id=-1)