[wxPython-users] Toolbook inside panel won't display
Frank Aune
Frank.Aune at broadpark.no
Mon Nov 19 04:37:47 PST 2007
On Monday 19 November 2007 12:29:08 Andrea Gavana wrote:
> It doesn't matter: if your toolbook is a child of this dummy panel
> (and not a direct child of the notebook), you should use a sizer: I
> don't know why in your second example you are making the toolbook
> child of the main frame, unless I didn't understand anything of what
> you are trying to achieve.
The reason for adding the toolbook as a child of the main frame, was only to
demonstrate that it "works", while the behaviour I was aiming for where the
toolbook was a child in the notebook did not.
Your response however triggered some follow-up questions:
- How can I make a toolbook object, and add this to a notebook page using
AddPage(), without using a dummy panel? Each time I call the toolbook
constructor, it will automatically attach itself to the parent given in the
constructor, and as I see it this must be the dummy panel?
- Is there a way to do this:
>
> sizer = wx.BoxSizer(wx.VERTICAL)
> sizer.Add(self.toolbook, 1, wx.EXPAND)
> self.panel.SetSizer(sizer)
> sizer.Layout()
from the XRC instead, so I could just give some kind of wx.Panel created from
an XRC ID to the toolbook constructor?
> In your attached example (using the first section, commenting out the
> second one) works here, if what you see is the behaviour you really
> want.
Yes, this was exactly what I was looking for. It demonstrates how to embed
toolbook object somewhere in my XRC.
Thank you very much - greatly appreciated!
-Frank
More information about the wxpython-users
mailing list