splitterwindow sash rapidly collapses

Hi, can someone help me understand why my splitterwindow
behavior is like this:

1. Run the attached sample.
2. Manually resize the frame from the right edge and make it smaller (less
    wide).
3. When you hit the point of the sash, the left side (the red
    wxscrolledwindow) will entirely collapse.

And there is other weirdness after that if you try to drag the sash
back to the right.

What am I doing wrong?

Thank you,
Che

splitter_sample.py (2.24 KB)

The splitter is trying to honor the min sizes of the children (if it is set) to limit how much it will resize the children. Currently container windows that have no children will get their min size set to the current size when it is queried the first time, so in your case the min sizes pretty much prevent the splitter from doing any resizing or sash modifications at all. Try setting the min size of the panels to something like (20,20).

···

On 10/12/09 10:07 PM, C M wrote:

Hi, can someone help me understand why my splitterwindow
behavior is like this:

1. Run the attached sample.
2. Manually resize the frame from the right edge and make it smaller (less
     wide).
3. When you hit the point of the sash, the left side (the red
     wxscrolledwindow) will entirely collapse.

And there is other weirdness after that if you try to drag the sash
back to the right.

What am I doing wrong?

--
Robin Dunn
Software Craftsman

Thanks, Robin, that did allow the sash to move more gradually.

My problem now is that, in the same example (again attached),
if I doubleclick on the sash, the red/left scrolledwindow is
expanded to take up the whole splitterwindow, and the green
window on the right cannot be gotten back. Is it supposed to
do that? How can I prevent it? (as it would be frustrating for
users to accidentally click there and obliterate a panel).

Thanks,
Che

splitter_sample.py (2.43 KB)

···

On Tue, Oct 13, 2009 at 8:30 PM, Robin Dunn <robin@alldunn.com> wrote:

On 10/12/09 10:07 PM, C M wrote:

Hi, can someone help me understand why my splitterwindow
behavior is like this:

1. Run the attached sample.
2. Manually resize the frame from the right edge and make it smaller (less
wide).
3. When you hit the point of the sash, the left side (the red
wxscrolledwindow) will entirely collapse.

And there is other weirdness after that if you try to drag the sash
back to the right.

What am I doing wrong?

The splitter is trying to honor the min sizes of the children (if it is
set) to limit how much it will resize the children. Currently container
windows that have no children will get their min size set to the current
size when it is queried the first time, so in your case the min sizes
pretty much prevent the splitter from doing any resizing or sash
modifications at all. Try setting the min size of the panels to
something like (20,20).

--
Robin Dunn
Software Craftsman
http://wxPython.org

My problem now is that, in the same example (again attached),
if I doubleclick on the sash, the red/left scrolledwindow is
expanded to take up the whole splitterwindow, and the green
window on the right cannot be gotten back. Is it supposed to
do that?

Yes, it is default behavior that calls Unsplit() on the double click.

How can I prevent it?

You can catch the EVT_SPLITTER_DCLICK event and not call Skip so the default handler is not called. Also, I think that if you set the minimum pane size to something other than zero then it won't unsplit by default.

···

On 10/13/09 9:16 PM, C M wrote:

--
Robin Dunn
Software Craftsman

Thanks again--minimum pane size adjustment works well for me.
-Che

···

On Wed, Oct 14, 2009 at 12:21 PM, Robin Dunn <robin@alldunn.com> wrote:

On 10/13/09 9:16 PM, C M wrote:

My problem now is that, in the same example (again attached),
if I doubleclick on the sash, the red/left scrolledwindow is
expanded to take up the whole splitterwindow, and the green
window on the right cannot be gotten back. Is it supposed to
do that?

Yes, it is default behavior that calls Unsplit() on the double click.

How can I prevent it?

You can catch the EVT_SPLITTER_DCLICK event and not call Skip so the
default handler is not called. Also, I think that if you set the
minimum pane size to something other than zero then it won't unsplit by
default.

--
Robin Dunn
Software Craftsman
http://wxPython.org