A change in Sizers from 2.8.12.1 to 2.9.4.0

Hi all,

The simple example file I've attached behaves very differently in wxPython 2.8.12.1 and 2.9.4.0, at least on Windows. (I haven't tested it on other platforms.)

The example app simply shows 6 colored panels with an initial size of 320 x 240 each in BoxSizers and prints the size of a couple of those panels as you resize the application.

In 2.8.12.1, the panels get shrunk by the sizer.Fit() call, are initially displayed very small, and all display the same size change as you resize the app.

In 2.9.4.0, the panels retain their originally defined size for initial presentation. They all grow identically when you enlarge the application. But when you shrink the application to smaller than its original size, they do NOT shrink identically. The right column and bottom row panels shrink, while the other panels retain their original size, like that is retained as a minimum size. They seem to lose the proportionality that I thought the Sizer was supposed to give them and that they display when they are larger than their original size.

What I can't figure out is how to make it so the panels will shrink when I shrink the app to smaller than its original size, but retaining their identical proportions. Sizer proportion is more important than original size in my real application.

I hope I'm just missing something simple, but I can't find a solution. Thanks in advance for your suggestions.

David

SizerTest.py (1.67 KB)

Hi all,

The simple example file I’ve attached behaves very differently in
wxPython 2.8.12.1 and 2.9.4.0, at least on Windows. (I haven’t tested
it on other platforms.)

The example app simply shows 6 colored panels with an initial size of
320 x 240 each in BoxSizers and prints the size of a couple of those
panels as you resize the application.

In 2.8.12.1, the panels get shrunk by the sizer.Fit() call, are
initially displayed very small, and all display the same size change as
you resize the app.

In 2.9.4.0, the panels retain their originally defined size for initial
presentation. They all grow identically when you enlarge the
application. But when you shrink the application to smaller than its
original size, they do NOT shrink identically. The right column and
bottom row panels shrink, while the other panels retain their original
size, like that is retained as a minimum size. They seem to lose the
proportionality that I thought the Sizer was supposed to give them and
that they display when they are larger than their original size.

What I can’t figure out is how to make it so the panels will shrink when
I shrink the app to smaller than its original size, but retaining their
identical proportions. Sizer proportion is more important than original
size in my real application.

I hope I’m just missing something simple, but I can’t find a solution.

Thanks in advance for your suggestions.

David

Hi again,

As so often happens, I found the solution myself shortly after posting.

It appears that sizers have a minimum size that gets set automatically now. sizer.GetMinSize() reports my panels had a minimum size of their original size, and sizer.SetMinSize() allows me to change it.

David

Sorry, I mis-spoke. The PANELS, not the sizers, now have a minimum
size they didn’t used to have that the sizers try to respect. I’ll shut up now.

···

On 04/11/2013 02:04 PM, David wrote:

    Hi all,




    The simple example file I've attached behaves very differently

in

    wxPython 2.8.12.1 and 2.9.4.0, at least on Windows.  (I haven't

tested

    it on other platforms.)




    The example app simply shows 6 colored panels with an initial

size of

    320 x 240 each in BoxSizers and prints the size of a couple of

those

    panels as you resize the application.




    In 2.8.12.1, the panels get shrunk by the sizer.Fit() call, are


    initially displayed very small, and all display the same size

change as

    you resize the app.




    In 2.9.4.0, the panels retain their originally defined size for

initial

    presentation.  They all grow identically when you enlarge the

    application.  But when you shrink the application to smaller

than its

    original size, they do NOT shrink identically.  The right column

and

    bottom row panels shrink, while the other panels retain their

original

    size, like that is retained as a minimum size.  They seem to

lose the

    proportionality that I thought the Sizer was supposed to give

them and

    that they display when they are larger than their original size.




    What I can't figure out is how to make it so the panels will

shrink when

    I shrink the app to smaller than its original size, but

retaining their

    identical proportions.  Sizer proportion is more important than

original

    size in my real application.




    I hope I'm just missing something simple, but I can't find a

solution.

    Thanks in advance for your suggestions.




    David
    Hi again,



    As so often happens, I found the solution myself shortly after

posting.

    It appears that sizers have a minimum size that gets set

automatically now. sizer.GetMinSize() reports my panels had a
minimum size of their original size, and sizer.SetMinSize()
allows me to change it.

David Woods wrote:

What I can't figure out is how to make it so the panels will shrink when
I shrink the app to smaller than its original size, but retaining their
identical proportions. Sizer proportion is more important than original
size in my real application.

Hello David,

Don't set sizes on the panels - set the size of the dialog instead,
and don't call Fit.

regards, Anders