[wxPython-users] (Yet another) sizer question

Josiah Carlson jcarlson at uci.edu
Tue Jun 6 14:47:35 PDT 2006


"Frank Millman" <frank at chagford.com> wrote:
> Say I have a splitter window with a vertical sash, and a tree control in the
> left pane.
> 
> If the tree gets too big, I can drag the sash to the right. The left pane
> gets bigger, but the right pane gets smaller, which may not be what I want.
> 
> If instead I drag the right-hand border to the right, the right pane gets
> bigger, and the left pane stays the same.
> 
> I was hoping that, if I drag the left-hand border to the left, the left pane
> would get bigger, and the right pane would stay the same. In fact, it is
> still the right pane that gets bigger, and the left pane stays the same.
> 
> I think that this is how the native control works. For example, if I try
> this with Windows Explorer, it behaves in the same way.
> 
> Is it possible to achieve what I want? To do so, I would need to detect that
> the left-hand border was being dragged, and then calculate a new position
> for the sash, but I have not seen an event that gives this information.
> 
> The question is academic - I doubt if I would actually go to these lengths -
> but it would be interesting to know if it is possible.
> 
> Any suggestions?

I spent a while dealing with splitters for doing that exact same thing
in PyPE (it was always a bit off).  Then I discovered SashLayoutWindows.
They work very much the same way as splitters, though you can set them
up such that particular portions are somewhat "fixed" in size.  Resizing
the window will resize the non-"fixed" portion.  It's in the demo as
"SashWindow".

 - Josiah





More information about the wxpython-users mailing list