wx.aui: resize pane

Are you writing your own components and need help with how to set them up or have questions about the components you are deriving from ? Ask them here.
Post Reply
masics
In need of some credit
In need of some credit
Posts: 4
Joined: Mon Apr 20, 2009 7:20 am

wx.aui: resize pane

Post by masics » Mon Apr 20, 2009 7:55 am

I have a pane with dynamic content. Each time I change the content I want the pane resized to fit all elements.
I do following:
1. Get size of the pane;'s main sizer
2. pane.MinSize(x,y)
3. pane.MaxSize(x,y)

The MinSize is working. But MaxSize - does not. The pane size remains bigger than the sizer size.

Is there anything else I should do to make it working?

Thanks a lot.

Infinity_77
Experienced Solver
Experienced Solver
Posts: 89
Joined: Tue Oct 03, 2006 6:30 pm
Location: London, UK
Contact:

Re: wx.aui: resize pane

Post by Infinity_77 » Mon Apr 20, 2009 8:08 am

Hi,
masics wrote:I have a pane with dynamic content. Each time I change the content I want the pane resized to fit all elements.
I do following:
1. Get size of the pane;'s main sizer
2. pane.MinSize(x,y)
3. pane.MaxSize(x,y)

The MinSize is working. But MaxSize - does not. The pane size remains bigger than the sizer size.

Is there anything else I should do to make it working?

Thanks a lot.
wxAUI as it stands now does not enforce MaxSize on panes (i.e., as far as I remember, the MaxSize() is not fully implemented). But, if you are using wxPython, you may consider my version of AUI in the custom library I wrote for wxPython here:

http://svn.wxwidgets.org/viewvc/wx/wxPy ... W/agw/aui/

Which enforces MaxSize and has a number of other goodies wxAUI doesn't have.

Andrea.
"Imagination Is The Only Weapon In The War Against Reality."

http://xoomer.alice.it/infinity77/

masics
In need of some credit
In need of some credit
Posts: 4
Joined: Mon Apr 20, 2009 7:20 am

Post by masics » Mon Apr 20, 2009 8:24 am

Your version behaves quite different from the original.
Why don't you accept size as tuple?
With your version it looks like "grow" is not working.

Infinity_77
Experienced Solver
Experienced Solver
Posts: 89
Joined: Tue Oct 03, 2006 6:30 pm
Location: London, UK
Contact:

Post by Infinity_77 » Mon Apr 20, 2009 8:36 am

masics wrote:Your version behaves quite different from the original.
No it does not. It's not the behaviour, it's just the look and feel.
Why don't you accept size as tuple?
This is Python, not C++. You have the option to pass a wx.Size or a pair of x, y, i.e.:

MinSize(wx.Size(200, 100))
MinSize(200, 100)

Python doesn't have the C++ ability (useful, but confusing) to define the same method with 10 different signatures like wxWidgets does.
With your version it looks like "grow" is not working.
"grow" is not a wxAUI keyword. Either post some code or please explain what you mean.
"Imagination Is The Only Weapon In The War Against Reality."

http://xoomer.alice.it/infinity77/

masics
In need of some credit
In need of some credit
Posts: 4
Joined: Mon Apr 20, 2009 7:20 am

Post by masics » Mon Apr 20, 2009 8:45 am

This is Python, not C++. You have the option to pass a wx.Size or a pair of x, y, i.e.:

MinSize(wx.Size(200, 100))
MinSize(200, 100)

Python doesn't have the C++ ability (useful, but confusing) to define the same method with 10 different signatures like wxWidgets does.
In original wx I can define aui.AuiPaneInfo().BestSize((240, 100))
"grow" is not a wxAUI keyword. Either post some code or please explain what you mean.
It looks like pane.MaxSize((-1, y)) is working different. If panel is smaller than previous I still see the remains of the first one.

Post Reply