It is possible to "load on self" with XRC, which seems to be what is
wanted here. It is done using the 2-phase create scheme that wxWidgets
provides, except in this case XRC calls the Create() method. It would
be done something like this:
class ConfigDialog(wx.Dialog):
def __init__(self, parent):
self.res = xrc.XmlResource("config_dialog.xrc")
pre = wx.PreDialog()
self.res.LoadOnDialog(pre, parent, "ConfigDlg")
self.PostCreate(pre)
Notice the use of wx.PreDialog() (this is wxPython's name for the
"default" C++ constructor) and LoadOnDialog. The PostCreate method is
used to transfer the guts of pre into self, so it acts like it was a
real instance of ConfigDialog.
--
Robin Dunn
Software Craftsman
http://wxPython.org
It is possible to "load on self" with XRC, which seems to be what is
wanted here. It is done using the 2-phase create scheme that wxWidgets
provides, except in this case XRC calls the Create() method. It would
be done something like this:class ConfigDialog(wx.Dialog):
def __init__(self, parent):
self.res = xrc.XmlResource("config_dialog.xrc")
pre = wx.PreDialog()
self.res.LoadOnDialog(pre, parent, "ConfigDlg")
self.PostCreate(pre)Notice the use of wx.PreDialog() (this is wxPython's name for the
"default" C++ constructor) and LoadOnDialog. The PostCreate method is
used to transfer the guts of pre into self, so it acts like it was a
real instance of ConfigDialog.