Shrink Panels Proportionately

Hi all,

I have an application that lays out nicely but when resized to be smaller, starts to collapse in on itself. I originally had set the minimum size so the frame couldn’t be resized to be smaller, but the person I am writing for did not want that. I believe I am using the sizers correctly, though there is a mix between box sizers, gridbagsizers, etc. Is there a way to keep the formatting and just shrink the widgets with the panel instead of just hiding the widgets?

I will try to explain the setup as much as possible:

There are two panels, each filled with their own widgets.

One of them is comprised of a vertical boxsizer, a flexgridsizer, and a gridbagsizer that contains both of the other sizers in additon to other widgets.

The other panel has other panels embedded in it via a vertical box sizer. Those other panels have gridbagsizers in them.

When I setup the application, I place the two panels next to eachother via a horizontal box sizer. The flag wx.EXPAND is set for both and one of them is set to grow twice as fast as the other.

All of the panels have had their sizers set and fitted.

Attached are some screen shots of how it looks like when not resized, and how it looks like when it is collapsed. I just want everything to shrink. I was wondering if I need to use the same type of sizers for that to happen.

Thank you,

Josh

Collapse.png

OK.png

You can use the WIT to examine widget properties like minsize and best size, or you can even use it to fiddle with widget or sizer item properties and then see how that affects the layout. That will often help you figure out what needs changed in your code.

http://wiki.wxpython.org/Widget_Inspection_Tool

···

On 7/24/12 2:51 PM, jskoeh9 wrote:

Hi all,

I have an application that lays out nicely but when resized to be
smaller, starts to collapse in on itself. I originally had set the
minimum size so the frame couldn't be resized to be smaller, but the
person I am writing for did not want that. I believe I am using the
sizers correctly, though there is a mix between box sizers,
gridbagsizers, etc. Is there a way to keep the formatting and just
shrink the widgets with the panel instead of just hiding the widgets?

I will try to explain the setup as much as possible:

There are two panels, each filled with their own widgets.

One of them is comprised of a vertical boxsizer, a flexgridsizer, and a
gridbagsizer that contains both of the other sizers in additon to other
widgets.

The other panel has other panels embedded in it via a vertical box
sizer. Those other panels have gridbagsizers in them.

When I setup the application, I place the two panels next to eachother
via a horizontal box sizer. The flag wx.EXPAND is set for both and one
of them is set to grow twice as fast as the other.

All of the panels have had their sizers set and fitted.

Attached are some screen shots of how it looks like when not resized,
and how it looks like when it is collapsed. I just want everything to
shrink. I was wondering if I need to use the same type of sizers for
that to happen.

--
Robin Dunn
Software Craftsman