From: Facundo B. <fac...@gm...> - 2005-08-30 13:55:26
|
Alguien puede probar esto? Yo no hasta que vuelva a casa, :p Grazie. ---------- Forwarded message ---------- From: Peter Damoc <pd...@gm...> Date: 26-ago-2005 3:24 Subject: Re: [wxPython-users] dynamic space between buttons To: wxP...@li... On Thu, 25 Aug 2005 22:13:32 +0300, Facundo Batista <fac...@gm...> wrote: > Hello! > > I want to have a panel, with four buttons. Three of them are aligned > to the left, and the fourth y aligned to the right. The final > behaviour is that if I resize the panel, the fourth button gets away > or closer to the rest of the buttons (IOW, the space between the three > buttons, and the fourth, grows and shrinks). > > Didn't know how to do that. Then searched in Internet, and found that > I have to insert something between the group of three and the fourth: > > some_boxsizer.Add(0, 0, 1) I don't think this in not the suggested way! What you need is to add a component between the 3rd and 4th button and give that component 1 as proportion prameter (it should grow in the direction of the sizer) interface for sizer.Add is: (I'm assuming a BoxSizer) sizer.Add(component, proportion, style, border) wxpython is smart enough to interpret a tupple as empty space defined by the values in the tupple so, if you use something like (1,1) as component it will simply add space (this is what you need) SO your line should look like: some_boxsizer.Add((1, 1), 1) > The problem is that in some places works ok, but in others just raises > an excetpion. > > Do you please know how to do this in a safer way? > > Thank you very much! > > . Facundo > > Blog: http://www.taniquetil.com.ar/plog/ > PyAr: http://www.python.org/ar/ > |