MultiSplitterWindow and the sash position

Hi

In the new MultiSplitterWindow one can move the sashes out of the window
either to the right or the bottom side. You can see it the demo, if you
don't maximize the window and just move one sash to the right.
Annoying is, that the sash is 'lost', if you release the mouse button.
And you can't set a minimum size for the rightmost (or bottommost) panel.

At first I was thinking about a problem with the size of the whole
splitter-window. But GetSize() returns the correct size.

Another question: Is there a way to set the position of the sash
programmatically? Something like 'SetSashPosition(sashId, pos)'? AFAICS
this is only possible in the MultiSplitterEvent...

thanks & cu boesi

···

--

Frueher hattet ihr die Freiheit zu entscheiden
Heute seid ihr von dieser Entscheidung befreit
                       .-==Report der Magd==-.

Alexander 'boesi' Bösecke wrote:

Hi

In the new MultiSplitterWindow one can move the sashes out of the window
either to the right or the bottom side. You can see it the demo, if you
don't maximize the window and just move one sash to the right.
Annoying is, that the sash is 'lost', if you release the mouse button.
And you can't set a minimum size for the rightmost (or bottommost) panel.

That is something that probably should be fixed. If you would like to work up a patch that would fix the splitter to honor a minsize on the last panel I'll apply it.

At first I was thinking about a problem with the size of the whole
splitter-window. But GetSize() returns the correct size.

Another question: Is there a way to set the position of the sash
programmatically? Something like 'SetSashPosition(sashId, pos)'? AFAICS
this is only possible in the MultiSplitterEvent...

This should do it:

     def SetSashPosition(self, idx, pos):
         """
         Set the psition of the idx'th sash, measured from the left/top
         of the window preceding the sash.
         """
         assert idx < len(self._sashes)
         self._sashes[idx] = pos
         self._SizeWindows()

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn wrote:

Alexander 'boesi' Bösecke wrote:

Hi

In the new MultiSplitterWindow one can move the sashes out of the window
either to the right or the bottom side. You can see it the demo, if you
don't maximize the window and just move one sash to the right.
Annoying is, that the sash is 'lost', if you release the mouse button.
And you can't set a minimum size for the rightmost (or bottommost) panel.

That is something that probably should be fixed. If you would like to work up a patch that would fix the splitter to honor a minsize on the last panel I'll apply it.

I don't know if this is just a workaround, but I was able to prevent that from happening with:
    self.splitWindow.SetMinimumPaneSize(20)

I agree, though, that the widget itself should prevent the loss of the sash, unless it also provides some way for the user to get it back.

···

--
Don Dwiggins
Advanced Publishing Technology

Hi

I don't know if this is just a workaround, but I was able to prevent
that from happening with:
    self.splitWindow.SetMinimumPaneSize(20)

Which Splitter-Window do you mean? The _Multi_SplitterWindow supports
this function - but the min-size is ignored for the last (rightmost or
bottommost) panel.

I agree, though, that the widget itself should prevent the loss of the
sash, unless it also provides some way for the user to get it back.

Well you could react to the corresponding event... but that's not the
point. The point is that the function above doesn't work correctly.

To Robin: I'm trying to find some time for the patch...

cu boesi

···

Am 02.05.2006 19:28:12 schrieb Don Dwiggins:
--
--==SECURITY ALERT==--
Your Computer Is Currently Broadcasting An
Internet IP Address. With This Address,
Someone Can Begin Attacking Your Computer.