title: How do I scroll to the bottom of a ScrolledWindow when using a sizer
body: <p>I am creating a text area in wxpython that needs to be scrollable and dynamically sized. I've borrowed <a href="http://wiki.wxpython.org/ScrolledWindows" rel="nofollow">some code</a>, which which works fine except that I don't seem to be able to make use of the <code>ScrolledWindow.Scroll</code> command.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>import wx
  class AScrolledWindow(wx.ScrolledWindow):
      def __init__(self, parent):
          self.parent = parent
          wx.ScrolledWindow.__init__(self, parent, -1, style=wx.TAB_TRAVERSAL)
          gb = wx.GridBagSizer(vgap=0, hgap=3)
          self.sizer = gb
          self._labels = []
          for y in xrange(1,30):
              self._labels.append(wx.StaticText(self, -1, "Label #%d" % (y,)))
              gb.Add(self._labels[-1], (y,1), (1,1))
          self.SetSizer(self.sizer)
          fontsz = wx.SystemSettings.GetFont(wx.SYS_SYSTEM_FONT).GetPixelSize()
          self.SetScrollRate(fontsz.x, fontsz.y)
          self.EnableScrolling(True,True)
          self.Scroll(0,100)
  
  class TestFrame(wx.Frame):
      def __init__(self):
          wx.Frame.__init__(self, None, -1, 'Programmatic size change')
          sz = wx.BoxSizer(wx.VERTICAL)
          pa = AScrolledWindow(self)
          sz.Add(pa, 1, wx.EXPAND)
          self.SetSizer(sz)
          pa.Scroll(0,100)
  
  def main():
      wxapp = wx.App()
      fr = TestFrame()
      fr.Show(True)
      wxapp.MainLoop()
  
  if __name__=='__main__':
      main()
  </code></pre>
  
  <p>I've tested the <code>ScrolledWindow.Scroll</code> command without the sizer and it works, suggesting to me that it doesn't work with the sizer. However there is no mention in the documentation of this effect.</p>