]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/wx/tools/pywxrc.py
fix building/running of tex2rtf
[wxWidgets.git] / wxPython / wx / tools / pywxrc.py
index f26fb00f4f20924be58ea8e3dc5d1235abac5386..9093b2e12591a64e78414a82f24c2b0a7b3e07e7 100644 (file)
@@ -56,7 +56,7 @@ def get_resources():
 
     CLASS_HEADER = """\
 class xrc%(windowName)s(wx.%(windowClass)s):
-    def PreCreate(self):
+    def PreCreate(self, pre):
         \"\"\" This function is called during the class's initialization.
         
         Override it for custom setup before the window is created usually to
@@ -66,8 +66,8 @@ class xrc%(windowName)s(wx.%(windowClass)s):
     def __init__(self, parent):
         # Two stage creation (see http://wiki.wxpython.org/index.cgi/TwoStageCreation)
         pre = wx.Pre%(windowClass)s()
+        self.PreCreate(pre)
         get_resources().LoadOn%(windowClass)s(pre, parent, "%(windowName)s")
-        self.PreCreate()
         self.PostCreate(pre)
 
         # Define variables for the controls
@@ -227,7 +227,7 @@ class XmlResourceCompiler:
             windowClass = re.sub("^wx", "", windowClass)
             windowName = topWindow.getAttribute("name")
             
-            if windowClass == "Menu":
+            if windowClass in ["Menu", "MenuItem"]:
                 outputList.append(self.templates.MENU_CLASS_HEADER % locals())
             else:
                 outputList.append(self.templates.CLASS_HEADER % locals())