]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/samples/wxPIA_book/Chapter-10/create_simple_menu.py
3 class MyFrame(wx
.Frame
):
5 wx
.Frame
.__init
__(self
, None, -1, "Simple Menu Example")
8 simple
= menu
.Append(-1, "Simple menu item")
10 exit
= menu
.Append(-1, "Exit")
11 self
.Bind(wx
.EVT_MENU
, self
.OnSimple
, simple
)
12 self
.Bind(wx
.EVT_MENU
, self
.OnExit
, exit
)
13 menuBar
= wx
.MenuBar()
14 menuBar
.Append(menu
, "Simple Menu")
15 self
.SetMenuBar(menuBar
)
17 def OnSimple(self
, event
):
18 wx
.MessageBox("You selected the simple menu item")
20 def OnExit(self
, event
):
23 if __name__
== "__main__":
24 app
= wx
.PySimpleApp()