[wxPython-users] (Yet another) sizer question

Peter Damoc pdamoc at gmail.com
Tue Jun 6 05:24:08 PDT 2006


On 6/6/06, Frank Millman <frank at chagford.com> wrote:
>
> ...
> 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?
>
> Thanks
>
> Frank
>


You can do anything you want! Impossible is nothing.
Think about it like this... you can implement an algorithm that will compute
sizes for the panels and use the available API to create the visual
representation that you need. All you have to do is bind event handlers to
the relevant events (size changes in frame, move, etc) and then track the
values that you need like let's say size of the frame plus position of the
frame using local variables. Monitoring changes in both size and position
you can take a decision on how to change the inner panels sizes and then use
the SplitterWindow API to put the splitter in its right position.

Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200606=
06/a449ee8d/attachment.htm


More information about the wxpython-users mailing list