Search code examples
wxpythonwxwidgets

Nested Splitter with Notebook and Panel in wxPython


I want to create simple window splitted horizontally. wx.Notebook with some tabs on top and simple wx.Panel under notebook. I cannot realize how to use wx.SplitterWindow() to do it. When I try different methods, notebook occupies all the window and bottom panel is unavailable.

Notice: I want a bottom panel to be viewable always. Not just for one notebook tab like in usual examples.

Or maybe splitted window is not a right way to achieve my needs?

window


Solution

  • You need a wx.BoxSizer with orient = VERTICAL

    Add first the notebook and then the bottom panel.

    You must tell which of these two items gets resized when the main window is resized. It can be any combination you like: all to the notebok, all to the panel, or in the proportion you wish.

    See sizer doc or google any wxsizer tutorial.