]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/wxMenu.py
fixed the width of the (week day as number) field, should be 1, not 2
[wxWidgets.git] / wxPython / demo / wxMenu.py
index 223a22270e7583d960e2c457e4f5d006435ce85c..87758ff783b07bcc22db06b7830bd5ca117948d1 100644 (file)
@@ -19,6 +19,12 @@ 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()
 
@@ -28,7 +34,7 @@ class MyFrame(wxFrame):
         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')