[wxPython] wxSplitter resizing questions

Thanks Robin-

Now that I've got resizing working, I need to be able to remove the mid
panel and add a new one.

I have the following function:

    def addMid( self, m ):
        children = self.midPanel.GetChildren()
        for c in children:
            self.midPanel.RemoveChild( c )
            self.midSizer.Remove( c )
        self.addMidPanel()
        self.midSizer.Add( m, 1, wxEXPAND )
        m.SetSize( self.midPanel.GetSizeTuple() )
        self.midSizer.Layout()

but it doesn't seem to work.
Any hints???

matt

···

-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: Thursday, September 20, 2001 11:51 AM
To: wxpython-users@lists.wxwindows.org
Subject: Re: [wxPython] wxSplitter resizing questions

My question is:

Is there an easy way to tell the l,m and r panels (and their contents)
to resize when the window size and/or sash position is changed?

Before

I put the panels in there I just put a tree control directly into l

and

it resized fine. Now with the panel, whenever there is a resize the
tree control stays the same size the whole time.

As you've discovered, the splitter window only resizes it's immediate
children to fit into the client areas. If the child also has children
that
must be laid out then you need to manage that yourself. One way to do
it is
to put the children in a sizer and assign the sizer to the panel. In
your
example, something like this:

    sizer = wxBoxSizer(wxVERTICAL)
    sizer.Add(tree, 1, wxEXPAND)
    panel.SetSizer(sizer)
    panel.SetAutoLayout(true)

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

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users