Remove obsolete argument from PreCreate().

With the `pre` object magic gone, there is no need to pass another
argument to the PreCreate() method, which can now just use `self`.

Note that this is will probably lead to incompatibilities for users of
the generated class who override this method, as advised in the
template.
This commit is contained in:
André Colomb
2018-02-05 09:35:05 +01:00
parent 6883afe8ce
commit c655b09012

View File

@@ -62,7 +62,7 @@ def get_resources():
CLASS_HEADER = """\
class xrc%(windowName)s(wx.%(windowClass)s):
#!XRCED:begin-block:xrc%(windowName)s.PreCreate
def PreCreate(self, pre):
def PreCreate(self):
\"\"\" This function is called during the class's initialization.
Override it for custom setup before the window is created usually to
@@ -75,7 +75,7 @@ class xrc%(windowName)s(wx.%(windowClass)s):
def __init__(self, parent):
# Two stage creation (see http://wiki.wxpython.org/index.cgi/TwoStageCreation)
wx.%(windowClass)s.__init__(self)
self.PreCreate(self)
self.PreCreate()
get_resources().Load%(windowClass)s(self, parent, "%(windowName)s")
# Define variables for the controls, bind event handlers