title: Python: How to show a dialog window, and work simultaneously
body: <p>Consider this:</p>
  
  <pre><code>import wx, time
  
  # STEP 1: Setup Window
  class Window(wx.Frame):
      def __init__(self,parent,id):
          wx.Frame.__init__(self,parent,id,'Bobby the Window', size=(300,200))
          panel = wx.Panel(self)
          self.Bind(wx.EVT_CLOSE, self.closewindow)
  
      wx.StaticText(panel, -1, "Yo user, the program is busy doing stuff!", (50,100), (200,100))
  
  def closewindow(self, event):
      self.Destroy()
  
  # STEP 2: Show Window (run in background, probably with threading, if that is the best way)
  if __name__=='__main__':
      app = wx.PySimpleApp()
      frame = Window(parent=None,id=-1)
      frame.Show()
      app.MainLoop()
  
  # STEP 3: Do work
  time.sleep(5)
  
  # STEP 4: Close Window, and show user evidence of work
  ## *Update window to say: "I am done, heres what I got for you: ^blah blah info!^"*
  exit()
  </code></pre>
  
  <p>My questions are:</p>
  
  <ul>
  <li>In step 4, how do I change the text in the window (esp. if it is in a thread)?</li>
  <li>And in step 2, how do I run the window in the background, but still be able to communicate with it? (to update the text and such)</li>
  </ul>
  
  <p>This is similar to my question about how to run a cli progress bar and work at the same time, except with gui windows.</p>
  
  <p>I know that to change StaticText, I would do 'text.SetLabel("BLAH!")', but how would I communicate that with the window class if it is running in the background?</p>
  
  <p><strong>Update:</strong>
  <a href="https://stackoverflow.com/questions/8313169/is-it-still-not-enough-to-simply-use-threads-to-update-gui">This thread</a> was also some help.</p>