Tim van der Leeuw wrote:
Hi Martijn,
Hi All,
I do not want to do all initialisation of a wx.Frame in the OnInit
method of wx.App, but in wx.Frame.__init__()What I did:
class MainFrame(wx.Frame):
def __init__(self, res):
self.frame = res.LoadFrame(None,"main_frame")
<snip>You need to call the constructor of wx.Frame from your __init__ method:
wx.Frame.__init__(self, parent, id, title, ...)This might conflict with your desire to load the frame from a resource and set it as a property of your 'MainFrame'.
Since I don't use resources, I'm not sure how to solve that problem, since I don't use resources.
Use 2-phase create, like this:
class MainFrame(wx.Frame):
def __init__(self, res):
pre = wx.PreFrame()
res.LoadOnFrame(pre, None, "main_frame")
self.PostCreate(pre)
···
On Mon, Mar 24, 2008 at 1:37 PM, Martijn <martijn.brouwer@fiberworld.nl > <mailto:martijn.brouwer@fiberworld.nl>> wrote:
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!