Re: [Boa Constr] sizers problem
Status: Beta
Brought to you by:
riaan
From: Werner F. B. <wer...@fr...> - 2006-08-17 09:22:53
|
Hi Flavio, Flávio Codeço Coelho wrote: > Hi werner,, > > > I was curious about one thing. In the Book WxPython in action, in the examples > the position of the widgets is not set, which makes sense, since the sizers > should control the positions of the widgets. In Boa the positions of the > widgets remain in the code. (which stick to their specified positions). Sizers came to Boa only late in release 0.3 (if I remember correctly) and Boa is still supporting the other ways of controlling layouts (anchors and fixed position). So, you can ignore the fixed positions given to the controls. What I do when I create a new screen is: - create the frame or dialog - add the container (wx.Panel, wx.Notebook etc) - add the controls to the container - define the sizer(s) - add the controls to the sizer(s) - change the tab order to what it should be (sometimes I add controls not in the correct order) That should be it. Now if the container is a wx.Notebook then I create a separate module for each page to go onto the notebook (a wx.FramePanel on the "New" tab), this way one can use the designer to layout each page and then import the page into the main module. > > Another difference that I notice is that the example in the book call the > method fit on the main sizer: > > mainSizer.Fit(self) #self is the frame > > This is also something that boa does not do. If you need it you can do it by hand, e.g.: def __init__(self, parent): self._init_ctrls(parent) self.bsPage.Fit(self) Best regards Werner |