Page 1 of 1

wx.aui: resize pane

Posted: Mon Apr 20, 2009 7:55 am
by masics
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.

Re: wx.aui: resize pane

Posted: Mon Apr 20, 2009 8:08 am
by Infinity_77
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.

Posted: Mon Apr 20, 2009 8:24 am
by masics
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.

Posted: Mon Apr 20, 2009 8:36 am
by Infinity_77
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.

Posted: Mon Apr 20, 2009 8:45 am
by masics
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.