X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3115ef3e56082b961af85a06955b50ddf0c5738a..b9ac87bc5cbe46227195e32c44e25831f8206e3c:/wxPython/demo/wxMenu.py?ds=sidebyside diff --git a/wxPython/demo/wxMenu.py b/wxPython/demo/wxMenu.py index 223a22270e..bdbf93489b 100644 --- a/wxPython/demo/wxMenu.py +++ b/wxPython/demo/wxMenu.py @@ -19,16 +19,22 @@ class MyFrame(wxFrame): self.CreateStatusBar() self.SetStatusText("This is the statusbar") + tc = wxTextCtrl(self, -1, """ +A bunch of bogus menus have been created for this frame. You +can play around with them to see how they behave and then +check the source for this sample to see how to implement them. +""", style=wxTE_READONLY|wxTE_MULTILINE) + # Prepare the menu bar menuBar = wxMenuBar() # 1st menu from left menu1 = wxMenu() - menu1.Append(101, "Mercury", "This the text in the Statusbar") - menu1.Append(102, "Venus", "") - menu1.Append(103, "Earth", "You may select Earth too") + menu1.Append(101, "&Mercury", "This the text in the Statusbar") + menu1.Append(102, "&Venus", "") + menu1.Append(103, "&Earth", "You may select Earth too") menu1.AppendSeparator() - menu1.Append(104, "Exit", "Close this frame") + menu1.Append(104, "&Close", "Close this frame") # Add menu to the menu bar menuBar.Append(menu1, "&Planets") @@ -73,7 +79,7 @@ class MyFrame(wxFrame): EVT_MENU(self, 101, self.Menu101) EVT_MENU(self, 102, self.Menu102) EVT_MENU(self, 103, self.Menu103) - EVT_MENU(self, 104, self.OnCloseWindow) + EVT_MENU(self, 104, self.CloseWindow) EVT_MENU(self, 201, self.Menu201) EVT_MENU(self, 202, self.Menu202) @@ -103,8 +109,8 @@ class MyFrame(wxFrame): def Menu103(self, event): self.log.write('Welcome to the Earth\n') - def OnCloseWindow(self, event): - self.Destroy() + def CloseWindow(self, event): + self.Close() def Menu201(self, event): self.log.write('Chemical element number 1\n') @@ -145,7 +151,7 @@ class MyFrame(wxFrame): def runTest(frame, nb, log): win = MyFrame(frame, -1, log) frame.otherWin = win - win.Show(true) + win.Show(True) #-------------------------------------------------------------------