[wxPython-users] Layout of panel optionally in notebook

Simon Arrowsmith simon.arrowsmith at aprsmartlogik.com
Thu Sep 21 02:45:59 PDT 2006


On Wednesday 20 September 2006 20:28, Robin Dunn wrote:
> Simon Arrowsmith wrote:
> >  [ ... ] The problem: on Windows, the page
> > only lays out properly in the notebook form. [ ... ]
> > 
> > class OptionallyTabbedDialog(wx.Dialog):
> >     def __init__(self, parent, ID, tabs):
> > [ ... ]
> >         sizer.Fit(self)
> >         self.SetSizer(sizer)
> Try reversing the order of these last two calls.  It could be a simple 
> matter of there being only one size event, since the dialog is not 
> resizable, and that the window has no sizer set at the time of that event.

Thanks, that has sorted it out.

(The original code for the non-tabbed dialog put the controls directly
on the dialog rather than on an intermediate panel, and called Fit()
and SetSizer() in that order, and worked. The colleague who wrote it
says he got the recipe out of WxPython In Action. So what's best
practice?)

> > [ ... ]
> >         gbs.Fit(self)
> >         gbs.SetSizer(sizer)
> You probably have self.SetSizer(gbs) here instead of that last line, right?

Yes. I realised that my minimal failing example wasn't quite really
minimal as I was posting, and edited on the fly. Incorrectly 8-)

-- 
______________________________________________ 

APR Smartlogik Ltd.
Simon Arrowsmith
Senior Software Engineer
200 Rustat House, Clifton Road, Cambridge CB1 7EJ
tel:    +44 (0)1223 271 045
fax:  +44 (0)1223 271 010
map:    http://www.aprsmartlogik.com/maps_to_office.html
mailto:  simon.arrowsmith at aprsmartlogik.com 
web:  www.aprsmartlogik.com
*******************************************************
This e-mail may contain proprietary and confidential information and is 
intended for the recipient(s) only. If an addressing or transmission error 
has misdirected this e-mail, please notify the systems administrator by 
forwarding this e-mail to mailto:postmaster at aprsmartlogik.com. If you 
are not the intended recipient(s) - disclosure, distribution, copying or 
printing of this e-mail is strictly prohibited.
********************************************************





More information about the wxpython-users mailing list