]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/wx/tools/pywxrc.py
Remove const bool
[wxWidgets.git] / wxPython / wx / tools / pywxrc.py
index 997e2b81d0e3889b2a9bd22f815c930fc576494d..459a07674a9e6c1a26f0f24e7ade6fb9975cab31 100644 (file)
@@ -89,12 +89,19 @@ class xrc%(windowName)s(wx.%(windowClass)s):
         pre.thisown = 0
         if hasattr(self, '_setOORInfo'):
             self._setOORInfo(self)
-        if hasattr(self, '_setCallbackInfo'):
-            self._setCallbackInfo(self, self.__class__)
 
         # Define variables for the menu items
 """
 
+    MENUBAR_CLASS_HEADER = """\
+class xrc%(windowName)s(wx.%(windowClass)s):
+    def __init__(self):
+        pre = get_resources().LoadMenuBar("%(windowName)s")
+        self.PostCreate(pre)
+        
+        # Define variables for the menu items
+"""
+
     CREATE_MENUITEM_VAR = """\
         self.%(widgetName)s = self.FindItemById(xrc.XRCID(\"%(widgetName)s\"))
 """
@@ -227,7 +234,9 @@ class XmlResourceCompiler:
             windowClass = re.sub("^wx", "", windowClass)
             windowName = topWindow.getAttribute("name")
             
-            if windowClass == "Menu":
+            if windowClass in ["MenuBar"]:
+                outputList.append(self.templates.MENUBAR_CLASS_HEADER % locals())
+            elif windowClass in ["Menu"]:
                 outputList.append(self.templates.MENU_CLASS_HEADER % locals())
             else:
                 outputList.append(self.templates.CLASS_HEADER % locals())