title: Image is not displaying at runtime in panel, wxpython
body: <p>I am trying to display all images from image folder using for loop and that all displayed correctly. But i want to add another image at runtime so I use threading here <code>threading.Timer(2.0, self.basicgui).start()</code> whenever I add new image to folder i can see the name of image in image list but it can't be updated. i want to refresh panel to show updated image how can i fix this.</p>
  
  <pre class="lang-py prettyprint-override"><code>    import wx
      import threading
      from PIL import Image
      import wx.lib.scrolledpanel
      import os
  
  
      class windowclass(wx.Frame):
  
          def __init__(self, *args, **kwargs):
              super(windowclass, self).__init__(*args, **kwargs)
              global panel1
              panel1 = wx.Panel(self,size=(1000,28), pos=(0,0), style=wx.SIMPLE_BORDER)
              panel1.SetBackgroundColour('#FDDF99')
              global panel2
              panel2 = wx.lib.scrolledpanel.ScrolledPanel(panel1,-1, size=(350,710), pos=(1010,0), style=wx.SIMPLE_BORDER)
              panel2.SetupScrolling()
              panel2.SetBackgroundColour('#FFFFFF')
              self.basicgui()
  
  
          def basicgui(self):
              padding = 0
              bSizer = wx.BoxSizer( wx.VERTICAL )
              self.jpgs = GetJpgList("./image")
              allimage = len(self.jpgs)
              print(allimage)
  
  
              for i in range(0,allimage):
                  #print("i=",i)
                  bitmap = wx.Bitmap(self.jpgs[i])
                  image = wx.ImageFromBitmap(bitmap)
                  image = image.Scale(300, 200, wx.IMAGE_QUALITY_HIGH)
                  bitmap = wx.BitmapFromImage(image)
                  control = wx.StaticBitmap(panel2, -1, bitmap)
                  #print(control)
                  control.SetPosition((10, padding+10))
                  padding += 210
                  bSizer.Add( control, 0, wx.ALL, 5 )
              panel2.SetSizer( bSizer )
              panel2.Layout()
              threading.Timer(2.0, self.basicgui).start()        
              self.Show()
              return
  
  
      def GetJpgList(dir):
          jpgs = [f for f in os.listdir(dir) if f[-4:] == ".jpg"]
          # print "JPGS are:", jpgs
          return [os.path.join(dir, f) for f in jpgs]
  
  
      def main():
          app = wx.App()
          windowclass(None)
          app.MainLoop()
  
  
      main()
  </code></pre>