title: Keeping Panels From Growing in wxPython
body: <p>I'm attempting to arrange some panels in wxPython. A rough representation of the layout is here: <img src="https://i.stack.imgur.com/ZTDJJ.jpg" alt="Abstract example of the layout needed."></p>
  
  <p>Essentially, I'm looking for a left and right panel, such that - when resized - the left (orange) panel (and its contents) is never resized, and the right (blue) panel can stretch/grow as much as necessary, but only horizontally.</p>
  
  <p>The code I have thus far (with some random filler widgets) is below. My questions follow the code:</p>
  
  <pre><code>import wx
  import wx.lib.scrolledpanel as scrolled
  
  class MainWindow(wx.Frame):
      def __init__(self, parent, title):
          wx.Frame.__init__(self, parent)
  
          #add position panel
          posPnl = IdPanel(self)
          lbl1 = wx.StaticText(posPnl, label="Position")
          lbl2 = wx.StaticText(posPnl, label="Size")
          sizeCtrl = wx.TextCtrl(posPnl)
  
          posPnlSzr = wx.BoxSizer(wx.VERTICAL)
          posPnlSzr.Add(lbl1, 1, wx.FIXED&amp;wx.LEFT)
          posPnlSzr.Add(sizeCtrl, 1, wx.LEFT&amp;wx.FIXED)
          posPnlSzr.Add(lbl2, 1, wx.FIXED&amp;wx.LEFT)
  
          posPnl.SetSizer(posPnlSzr)
  
          posPnl2 = TimelinePanel(self)
          lbl12 = wx.StaticText(posPnl2, label="Position")
          lbl22 = wx.StaticText(posPnl2, label="Size")
          sizeCtrl2 = wx.TextCtrl(posPnl2)
  
          posPnlSzr2 = wx.BoxSizer(wx.VERTICAL)
          posPnlSzr2.Add(lbl12, 1, wx.GROW)
          posPnlSzr2.Add(sizeCtrl2, 1, wx.GROW)
          posPnlSzr2.Add(lbl22, 1, wx.GROW)
  
          posPnl2.SetSizer(posPnlSzr2)
  
          mainSzr = wx.BoxSizer(wx.HORIZONTAL)
          mainSzr.Add(posPnl, 1, wx.FIXED)
          #mainSzr.AddSpacer(10)
          mainSzr.Add(posPnl2, 1, wx.GROW)
  
          self.SetSizerAndFit(mainSzr)
          self.Show()
  
  class IdPanel(wx.Panel):
      def __init__(self, parent):
          wx.Panel.__init__(self, parent, -1, size = (400, 200))
          self.SetBackgroundColour((255, 0, 255))
  
  class TimelinePanel(scrolled.ScrolledPanel):
      def __init__(self, parent):
          scrolled.ScrolledPanel.__init__(self, parent, -1, size = (300, 200))
          self.SetBackgroundColour((255, 0, 0))
  
  
  app = wx.App(False)
  frame = MainWindow(None, "Trading Client")
  app.MainLoop()
  </code></pre>
  
  <p>My questions:</p>
  
  <ol>
  <li>How can I use sizers to ensure only the right panel expands, and only horizontally? Currently the contents of the left panel stay fixed, but the panel itself still expands.</li>
  <li>If I wanted to modify the first question slightly so that only the right expands horizontally, but both panels expand vertically, what would I need to do?</li>
  <li>I'm using a wx.lib.scrolledpanel for the x axis for the right panel, but I can't seem to contract the window horizontally at all to make it appear. I'm unsure if there's a setting about mix/max panel size, etc, that may help this?</li>
  </ol>