title: wxPython middle align items in sizer
body: <p>I am dynamically changing the number of wx objects in my GUI. The code is working but the alignment of the objects is not perfect. The static text objects are not middle aligned with the text objects. </p>
  
  <p><a href="https://i.stack.imgur.com/1MQA4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1MQA4.png" alt="misalignment"></a></p>
  
  <p>Notice that the word 'if' is not perfectly aligned with 'field name'.</p>
  
  <p>Code: </p>
  
  <pre><code>import wx
  
  
  ########################################################################
  class MyPanel(wx.Panel):
      """"""
  
      #----------------------------------------------------------------------
      def __init__(self, parent):
          """Constructor"""
          wx.Panel.__init__(self, parent)
          self.numRows = 0
          self.frame = parent
  
          #create sizers
          self.mainSizer = wx.BoxSizer(wx.VERTICAL)
          controlSizer = wx.BoxSizer(wx.HORIZONTAL)
          self.colSizer = wx.BoxSizer(wx.VERTICAL)
  
          self.addButton = wx.Button(self, label="Add")
          self.addButton.Bind(wx.EVT_BUTTON, self.onAddWidget)
          controlSizer.Add(self.addButton, 0, wx.CENTER|wx.ALL, 5)
  
          self.removeButton = wx.Button(self, label="Remove")
          self.removeButton.Bind(wx.EVT_BUTTON, self.onRemoveWidget)
          controlSizer.Add(self.removeButton, 0, wx.CENTER|wx.ALL, 5)
  
          self.mainSizer.Add(controlSizer, 0, wx.CENTER)
          self.mainSizer.Add(self.colSizer, 0, wx.CENTER|wx.ALL, 10)
  
          self.SetSizer(self.mainSizer)
  
      #----------------------------------------------------------------------
      def onAddWidget(self, event):
          """"""
          self.numRows += 1
  
          #create the objects
          rowSizer =wx.BoxSizer(wx.HORIZONTAL)
          ifText = wx.StaticText(self, -1, 'If')
          fieldBox1 = wx.TextCtrl(self, -1, 'Field Name')
          dropDown1 = wx.Choice(self, -1, choices=['&lt;', '&lt;=', '=', '&gt;=', '&gt;'])
          fieldBox2 = wx.TextCtrl(self, -1, 'Field Name')
          thenText = wx.StaticText(self, -1, 'Then')
          fieldBox3 = wx.TextCtrl(self, -1, 'Field Name')
  
  
          #create a list of all the objects
          objects = [ifText, fieldBox1, dropDown1, fieldBox2, thenText, fieldBox3]
  
          #add object to row sizer
          for myObject in objects:
              rowSizer.Add(myObject, 0, wx.ALL, 5)    
  
          #add the objects to the sizer
          self.colSizer.Add(rowSizer, 0, wx.ALL, 5)
  
          self.frame.fSizer.Layout()
          self.frame.Fit()
  
      #----------------------------------------------------------------------
      def onRemoveWidget(self, event):
          """"""
          if self.colSizer.GetChildren():
              self.colSizer.Hide(self.numRows-1)
              self.colSizer.Remove(self.numRows-1)
              self.numRows -= 1
              self.frame.fSizer.Layout()
              self.frame.Fit()
  
  ########################################################################
  class MyFrame(wx.Frame):
      """"""
  
      #----------------------------------------------------------------------
      def __init__(self):
          """Constructor"""
          wx.Frame.__init__(self, parent=None, title="Add / Remove Buttons")
          self.fSizer = wx.BoxSizer(wx.VERTICAL)
          panel = MyPanel(self)
          self.fSizer.Add(panel, 1, wx.EXPAND)
          self.SetSizer(self.fSizer)
          self.Fit()
          self.Show()
  
  #----------------------------------------------------------------------
  if __name__ == "__main__":
      app = wx.App(False)
      frame = MyFrame()
      app.MainLoop()
  
  del app
  </code></pre>
  
  <p>Please could someone advise on how I can fix this alignment issue.</p>
  
  <p>Thanks a lot in advance!</p>