title: separate threads in pygtk application
body: <p>I'm having some problems threading my pyGTK application.  I give the thread some time to complete its task, if there is a problem I just continue anyway but warn the user.  However once I continue, this thread stops until gtk.main_quit is called.  This is confusing me.</p>
  
  <p>The relevant code:</p>
  
  <pre><code>class MTP_Connection(threading.Thread):
      def __init__(self, HOME_DIR, username):
          self.filename = HOME_DIR + "mtp-dump_" + username
          threading.Thread.__init__(self)
  
      def run(self):
          #test run
          for i in range(1, 10):
              time.sleep(1)
              print i   
  </code></pre>
  
  <p>..........................</p>
  
  <pre><code>start_time = time.time()
  conn = MTP_Connection(self.HOME_DIR, self.username)
  conn.start()
  progress_bar = ProgressBar(self.tree.get_widget("progressbar"),
                             update_speed=100, pulse_mode=True)
  while conn.isAlive():
      while gtk.events_pending():
          gtk.main_iteration()
      if time.time() - start_time &gt; 5:
          self.write_info("problems closing connection.")
          break
  #after this the program continues normally, but my conn thread stops
  </code></pre>