PyGtk: Run gtk.main() loop in a seperate thread
<p>Below code is getting struck after the declaration og gtkLoopTHread itself, even though I am not giving gtkMainLoop.start() function call.
I want to run the timer in background and do some stuff in that UI and destroy the UI once the timer reaches '0'.</p>

<p><strong>Code</strong></p>

<pre><code>def createCountDown(maxSec):
  while maxSec &gt; 0:
    print maxSec;
    maxSec = maxSec - 1;

  gtk.main_quit();
  return;

maxSec = 5;
gtkLoopThread = threading.Thread(group=None, target=gtk.main, name=None, args=(), kwargs={});
print "After gtkThread declaration"
myThread = threading.Thread(group=None, target=createCountDown, name=None, args=(maxSec), kwargs={});
gtkLoopThread.start();
myThread.start();
</code></pre>

<p><strong>Expected Output:</strong></p>

<pre><code>After gtkThread declaration
5
4
3
2
1
</code></pre>

<p><strong>Current behaviour:</strong>
Line '<em>After gtkThread declaration</em>' print is not seen since gtkLoopThread starts immediately after initializing gtkLoopThread variable</p>