title: Add checkbox in wxPython in runtime
body: <p>I am pretty new to wxPython, so I generate GUI with wxFormBuilder and try to get extension from some folder and to create checkbox with these exts, but I got </p>
  
  <blockquote>
    <blockquote>
      <p>NameError: global name 'bSizer_Ext' is not defined</p>
    </blockquote>
  </blockquote>
  
  <p>Any suggestion will be appreciated.  Thank you.</p>
  
  <pre><code># -*- coding: utf-8 -*- 
  
  ###########################################################################
  ## Python code generated with wxFormBuilder (version Jun 30 2011)
  ## http://www.wxformbuilder.org/
  ##
  ## PLEASE DO "NOT" EDIT THIS FILE!
  ###########################################################################
  
  import wx
  import os
  
  ###########################################################################
  ## Class Test
  ###########################################################################
  
  class Test ( wx.Frame ):
      extensions=[]
      def __init__( self, parent ):
          wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = u"Test", pos = wx.DefaultPosition, size = wx.Size( 600,300 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL )
  
          self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
  
          bSizer1 = wx.BoxSizer( wx.VERTICAL )
  
          fg_DirSizer = wx.FlexGridSizer( 0, 2, 0, 2 )
          fg_DirSizer.AddGrowableCol( 1 )
          fg_DirSizer.SetFlexibleDirection( wx.BOTH )
          fg_DirSizer.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
  
          self.m_staticText_root = wx.StaticText( self, wx.ID_ANY, u"Root Directory", wx.DefaultPosition, wx.DefaultSize, 0 )
          self.m_staticText_root.Wrap( -1 )
          fg_DirSizer.Add( self.m_staticText_root, 0, wx.ALL, 5 )
  
          self.root_dir_pick = wx.DirPickerCtrl( self, wx.ID_ANY, wx.EmptyString, u"Select root folder", wx.DefaultPosition, wx.DefaultSize, wx.DIRP_DEFAULT_STYLE|wx.DIRP_DIR_MUST_EXIST|wx.TAB_TRAVERSAL )
          self.root_dir_pick.SetMinSize( wx.Size( 450,25 ) )
  
          fg_DirSizer.Add( self.root_dir_pick, 0, wx.ALL, 5 )
  
          bSizer1.Add( fg_DirSizer, 0, wx.EXPAND, 5 )
  
          bSizer_Ext = wx.BoxSizer( wx.VERTICAL )
  
          bSizer1.Add( bSizer_Ext, 1, wx.EXPAND, 5 )
  
          self.SetSizer( bSizer1 )
          self.Layout()
  
          self.Centre( wx.BOTH )
          self.Show(True)
  
          # Connect Events
          self.root_dir_pick.Bind( wx.EVT_DIRPICKER_CHANGED, self._ScanRoot )
  
      def __del__( self ):
          pass
  
  
      # Virtual event handlers, overide them in your derived class
      def _ScanRoot( self, event ):
          ext=''
          for root,dirs,files in os.walk(self.root_dir_pick.GetPath()):
              for f in files:
                  try:
                      ext = os.path.splitext(f)
                      self.extensions.index(ext[1])
                  except:
                      self.extensions.append(ext[1])
          for ext1 in self.extensions:
              chb=wx.CheckBox( bSizer_Ext, wx.ID_ANY, ext1, wx.DefaultPosition, wx.DefaultSize, 0 )
  
  
  if __name__ == "__main__":
      app = wx.App()
      frame = Test(None)
      app.MainLoop()
  </code></pre>