I have a window (subclass of wx.Frame).
I have 3 panels (each a subclass of wx.Panel).
I want to lay out the 3 panels using SashWindows (or SashLayoutWindows, not sure of the difference) like this:
···
±—±—±—+
…|…|…|
.P1.|.P2.|.P3.|
…|…|…|
±—±—±—+
I want P1 to be as narrow as its widgets allow and P2 and P3 to be the same width as each other and as wide as possible.
And if the user resizes the window I want the extra horizontal space going to P2 and P3 equally.
I’ve made a panel child of my wx.Frame:
self.panel = wx.Panel(self)
And I’ve created 3 sash windows using:
def make_sash(self):
sash = wx.adv.SashLayoutWindow(self.panel, style=wx.adv.SW_3D)
sash.Alignment = wx.adv.LAYOUT_LEFT
sash.Orientation = wx.adv.LAYOUT_VERTICAL
sash.SetSashVisible(wx.adv.SASH_RIGHT, True)
sash.SetExtraBorderSize(BORDER)
return sash
And I’ve created each panel (P1, P2, P3) as a child of its sash.
At the moment the panels are just placeholders, e.g.,
class Panel(wx.Panel):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
placeholder = wx.StaticText(self, label='ControlPanel')
sizer = wx.BoxSizer()
sizer.Add(placeholder, 1, wx.EXPAND)
sizer.Fit(self)
Can anyone advise me?