[wxPython] How do I place a wxSplitterWindow inside a pane of another wxSplitterWindow

Hi,

I'm trying to create a wxSplitterWindow inside the pane of another wxSplitterWindow, but so far it's not working. Here is the code I've got so far:

···

#---------------------------------------------
        # Set up a splitter for the main window
        #---------------------------------------------
        self.splitter1 = wxSplitterWindow(self, -1, style=wxSP_3D)
        self.splitter2 = wxSplitterWindow(self.splitter1.GetWindow1(), -1, style=wxSP_3D)
       
        def EmptyHandler(evt):
            pass
        
        EVT_ERASE_BACKGROUND(self.splitter1, EmptyHandler)
        EVT_ERASE_BACKGROUND(self.splitter2, EmptyHandler)

        #---------------------------------------------
        # Set up the right side of the app
        #---------------------------------------------
        self.topPanel = wxPanel(self.splitter1, -1)
        self.bottomPanel = wxPanel(self.splitter1, -1)

        #---------------------------------------------
        # Set up the splitter to have the tree on the left, and the panel
        # on the right
        #---------------------------------------------
        self.splitter1.SplitHorizontally(self.topPanel, self.bottomPanel, 195)
        self.splitter1.SetMinimumPaneSize(20)

        #---------------------------------------------
        # Set up the top side of the app
        #---------------------------------------------
        self.leftPanel = wxPanel(self.splitter2, -1)
        self.rightPanel = wxPanel(self.splitter2, -1)

        self.splitter2.SplitVertically(self.leftPanel, self.rightPanel, 50)
        self.splitter2.SetMinimumPaneSize(20)

Anyone got an idea what I'm doing wrong? The mainframe does come up with one splitter window, but not the other.

Thanks in advance,
Doug

I'm trying to create a wxSplitterWindow inside the pane of another
wxSplitterWindow, but so far it's not working. Here is the code
I've got so far:

        #---------------------------------------------
        # Set up a splitter for the main window
        #---------------------------------------------
        self.splitter1 = wxSplitterWindow(self, -1, style=wxSP_3D)
        self.splitter2 = wxSplitterWindow(self.splitter1.GetWindow1(),
-1, style=wxSP_3D)

You should use just "self.splitter1" for the parent of the second splitter.
At this point GetWindow1 will return None. If you were using the hybrid or
debug version of wxPython you would get an assert message about this.

What you probably want (if I understand you correctly) is this (view with
fixed width font):

frame <-- splitter <-- panel
             \
              \
               splitter <-- panel
                  \
                   \
                    panel

But what you have is this:

frame <-- splitter <-- panel
             \
              \
              panel

None <-- splitter <-- panel
             \
              \
              panel

···

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