dynamic space between buttons

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)

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/

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)

···

On Thu, 25 Aug 2005 22:13:32 +0300, Facundo Batista <facundobatista@gmail.com> wrote:

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: Bitácora de Vuelo
PyAr: http://www.python.org/ar/

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org