hiding a sashwindow

hi,
I have created sashwindows using the following
methods:

sash_problem.bmp (2.17 MB)

···

######################################
    def CreateMainWindow(self):
        winids = []

        self.main = wx.SashLayoutWindow(
                self, -1, wx.DefaultPosition, (200,
30),
                wx.NO_BORDER|wx.SW_3D
                )

        self.main.SetDefaultSize((800, 550))
        self.main.SetOrientation(wx.LAYOUT_HORIZONTAL)
        self.main.SetAlignment(wx.LAYOUT_TOP)
        self.main.SetBackgroundColour(wx.Colour(255,
255, 255))
        self.main.SetSashVisible(wx.SASH_BOTTOM, True)

        ogl = oglwin.Ogl(self.main)

        winids.append(self.main.GetId())

        self.d_Win = wx.Panel(self, -1,
style=wx.SUNKEN_BORDER)

        self.Bind(
            wx.EVT_SASH_DRAGGED_RANGE,
self.OnSashDrag,
            id=min(winids), id2=max(winids)
            )

        self.Bind(wx.EVT_SIZE, self.OnSize)

    def OnSashDrag(self, event):
        if
event.GetDragStatus()==wx.SASH_STATUS_OUT_OF_RANGE:
            return
        eobj = event.GetEventObject()

        if eobj is self.main:
            self.main.SetDefaultSize((800,
event.GetDragRect().height))

        wx.LayoutAlgorithm().LayoutWindow(self,
self.d_Win)
        self.d_Win.Refresh()

    def OnSize(self, event):
        wx.LayoutAlgorithm().LayoutWindow(self,
self.d_Win)

##################################3
I need to hide self.d_Win (the panel that takes up the
remaining space) so that the upper window is the only
one that's visible. I've tried self.d_Win.Hide(), but
the upper window does not resize to take up the free
space. I have also tried to do call OnSize after
hiding d_Win and also tried self.Refresh() but still
it doesn't change.

I have attached a screenshot of what it looks like
after trying self.d_Win.Hide().

I am using wx 2.6.3.3 but I am planning on installing
2.8 in light of new advice from Robin Dunn. :wink:

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com