Re: [Boa Constr] sizers problem
Status: Beta
Brought to you by:
riaan
From: <fcc...@fi...> - 2006-08-16 18:39:46
|
Hi werner,, I was curious about one thing. In the Book WxPython in action, in the examp= les=20 the position of the widgets is not set, which makes sense, since the sizers= =20 should control the positions of the widgets. In Boa the positions of the=20 widgets remain in the code. (which stick to their specified positions). Another difference that I notice is that the example in the book call the=20 method fit on the main sizer: mainSizer.Fit(self) #self is the frame This is also something that boa does not do. Do you think this may be the problem/ =46l=E1vio On Tuesday 15 August 2006 14:56, you wrote: > Hi Flavio, > > Fl=E1vio Code=E7o Coelho wrote: > > Hi Werner, > > Sorry to bother you again on this tricky subject of sizers. > > I applied you changes (thanks again) and improved the whole GUI a bit mor= e, > on my own. After some trial and error with the sizers, I managed to make = it > look the way I wanted. There is only one "annoyance" left: The sizers don= 't > resize!! > > Resizing of sizers is controlled by proportion parameter in the main > direction of the sizer and by the flag in the other direction (e.g. > wx.EXPAND). > > I think one of the problems you have is that the gridbagsizer is > controlling both items on the left and on the right side of your separati= on > line.=A0 I guess you could do this but then everything has to be in the > gridbagsizer. > > I did not catch on to this until a bit down the road of my trying around > with it, so I did it with two panels (left and right) and their > corresponding sizers.=A0 Now the order of the controls is probably not ri= ght > anymore, so you need to fix that. > > If you need a separation line, you can add that back in and insert it in > between the two panels in the bsPage sizer. > > You might also want to look into the splitterwindow control, you would p= ut > that just about at the top of your controls and make the two panels > children of it and assign them in the property tab to the left, > respectively to the right splitter.=A0 With the splitter you can move the > size allocated to the left or right side (check the demo). > > If you use the splitter then maybe instead of using a simple panel you > might want to replace them by scrolledPanel which gives you scrolling for > each side. > > Both the splitterWindow and the scrolledPanel are a bit a pain to get th= em > working. > > I attached the version I played around with, still needs cleaning up but > hopefully it will be helpful. > > Werner > > Could you help one more time with this? > > I am attaching the source code. > > Thanks in advance, > > Fl=E1vio > > On Friday 11 August 2006 16:16, you wrote: > > Hi Flavio, > > Flavio Codeco Coelho wrote: > > Thanks for the help Werner, > > Your welcome! > > > ... > The funny part of this is that all this code was created straight from > Boa in my machine at work but then at home, on a slightly more > up-to-date version of Boa, it didn't work... > > It is something Riaan is constantly trying to improve, but some of it is > out of his control. > > I thought you must be dreaming because it did not crash for me :-) , > until I started making changes. > > > Thanks, I had read about this somewhere, but it seemed like a > superfluous thing, why have a panel over a frame? And if this is so > indispensable, why the frame widget does not come with a panel > built-in from the start? > > Because there are many different containers: wx.Panel, wx.Notebook, > wx.ScrollPanel ........................ :-) > > > I did that because the example in the "WxPython in Action" book had > wx.EXPANDon all widgets... > > Hhm, better have a look at my copy again, but maybe in the sample you > are looking at it does make sense to expand. I am not sure that you > want to take this on just like this, it depends very much what you want. > > Sizers are a real art, they are neat when they work the way you want > them to work, but they are something totally different when they don't > do what you want. And don't think I master the art, I do a lot by trial > and error, especially if I come back to a layout which I did not work on > for soem time. > > > Thanks a lot for taking the time to help me. > > Your welcome. Many others have done and are still doing the same for > me, so I think it is just fair to help when one can. > > Werner =2D-=20 =20 =46l=E1vio Code=E7o Coelho, PhD Programa de Computa=E7=E3o Cient=EDfica =46unda=E7=E3o Oswaldo Cruz Rio de Janeiro -- Brasil |