Chris Mellon wrote
Hi!
Is there a way to keep the sash visible when the splitter window is unsplit?
Thanks,
KlausI'm guessing that you mean to have the sash drawn all the way against
Yes, that's right.
the side? In that case you want to override the Unsplit() behavior to
just make one of the windows 0 width (or height).
That doesn't seem to work. SetSashPosition(0) does nothing.
I could live with a size of 1, but there's an additional
problem: The user can still drag the sash to the border of the
frame, and then the sash disappears.
This is the splitter class I wrote to try it, and I am calling
toggleVisible() from the EVT_SPLITTER_DCLICK handler of the frame:
class Splitter(wx.SplitterWindow):
def __init__(self, *args, **kw):
wx.SplitterWindow.__init__(self, *args, **kw)
self.oldPosition = None
def toggleVisible(self):
if self.oldPosition:
self.SetSashPosition(self.oldPosition, True)
#self.SplitVertically(self.GetWindow1(), self.GetWindow2(), self.oldPosition)
self.oldPosition = None
else:
self.oldPosition = self.GetSashPosition()
self.Unsplit(self.GetWindow1())
def Unsplit(self, toRemove):
self.SetSashPosition(1, True)
···
On 9/17/07, Klaus Nowikow <klaus.nowikow@tuwien.ac.at> wrote: