title: wxpython -- threads and window events
body: <p>I have a wxPython application (<a href="http://www.OpenSTV.org" rel="nofollow noreferrer">http://www.OpenSTV.org</a>) that counts ballots using methods that have multiple rounds.  I'd like to do two things:</p>
  
  <p>(1) For a large number of ballots, this can be a bit slow, so I'd like to show the user a progress dialog so he doesn't think the application is frozen.</p>
  
  <p>(2) I'd like to allow the user to break ties manually, and this requires the counting code to show a dialog window.</p>
  
  <p>To achieve (1), I create a thread to run the counting code, and this allows me to present a nice progress dialog to the user.  </p>
  
  <p>The problem with this, however, is that the counting code is not the main thread, and only the main thread in wxPython can process window events.</p>
  
  <p>I suppose I could create a thread to run the progress dialog instead, but this seems awkward.  Is there a better way of accomplishing both (1) and (2)?</p>