-class MyFrame(wxFrame):
- def __init__(self,output):
- wxFrame.__init__(self,None,-1,"Close me...",size=(300,100))
- menubar = wxMenuBar()
- menu = wxMenu()
- mID = wxNewId()
- menu.Append(mID,"&Enable output","Display output frame")
- EVT_MENU(self,mID,output.EnableOutput)
- mID = wxNewId()
- menu.Append(mID,"&Disable output","Close output frame")
- EVT_MENU(self,mID,output.DisableOutput)
- menubar.Append(menu,"&Output")
+class MyFrame(wx.Frame):
+ def __init__(self, output):
+ wx.Frame.__init__(self, None, -1, "Close me...", size=(300,100))
+
+ menubar = wx.MenuBar()
+
+ # Output menu
+ menu = wx.Menu()
+
+ # Enable output menu item
+ mID = wx.NewId()
+ menu.Append(mID, "&Enable output", "Display output frame")
+ self.Bind(wx.EVT_MENU, output.EnableOutput, id=mID)
+
+ # Disable output menu item
+ mID = wx.NewId()
+ menu.Append(mID, "&Disable output", "Close output frame")
+ self.Bind(wx.EVT_MENU, output.DisableOutput, id=mID)
+
+ # Attach the menu to our menu bar
+ menubar.Append(menu, "&Output")
+
+ # Attach menu bar to frame