title: using time.sleep in wxPython
body: <p>Using time.sleep in my wxPython code just after re-positioning a bitmapbutton caused my button to go totally blank. Just a white space was left in the region where the button should have been. Can any one please explain the reason and suggest any solution? Here's my code:  </p>
  
  <pre><code>import wx
  import time
  class gui(wx.Frame):
    def __init__(self,parent,id):
      wx.Frame.__init__(self,parent,id,'New Window',pos=(0,0),size=wx.DisplaySize())
      panel=wx.Panel(self)
      self.SetBackGroundColour('green')
      self.pic=wx.BitmapButton(self,-1,wx.Image("Candle.jpg",wx.BITMAP_TYPE_ANY).ConvertToBitmap(),pos=(700,300))
      self.Bind(wx.EVT_BUTTON,self.position,self.pic)
    def positon(self,event):
      self.pic.Hide()
      self.pic=wx.BitmapButton(self,-1,wx.Image("Candle.jpg",wx.BITMAP_TYPE_ANY).ConvertToBitmap(),pos=(700,300))
      time.sleep(2)
      self.pic.Hide()
  if __name__=='__main__':
    app=wx.PySimpleApp()
    frame=gui(None,-1)
    frame.Show()
    app.MainLoop()
  </code></pre>