title: Updating the wx.gauge without while-loop
body: <p>Have been wondering about this for days now:</p>
  
  <p>I have a basic wxpython program like this:</p>
  
  <pre><code>from MyModule import *
  
  class Form(wx.Panel):
    def __init__(self, parent, id):
      self.gauge = wx.Gauge(...)
      ...
    def ButtonClick(self, event):
      proc = LongProcess()
      while (LongProcess):
        self.gauge.SetValue(LongProcess.status)
        wx.Yield()
  </code></pre>
  
  <p>which imports the MyModule.py:</p>
  
  <pre><code>from threading import *
  
  class LongProcess(self):
    def __init__(self):
      Thread.__init__(self)
      self.start()
    def run(self):
      for i in range(100):
        Do_something()
        self.status = i  
  </code></pre>
  
  <p>This updates the gauge according to the value LongProcess.status, as expected. But the while-loop doesn't seem appropriate as the whole program uses 100% cpu load because it continuously checks the status (not surprising, tho). Is there any way to send the status back to the "mother program" without doing that millions of times per second? </p>