title: GTK main blocks -- Python
body: <p>I am new to GTK and I stumbled upon a problem which sounds simple but I just can't find a way to deal with it. Basically, calling <code>gtk.main()</code> makes my single-threaded process halt. I know that <code>gtk.main()</code> is blocking, but I have not called <code>gtk.main()</code> any time before so quitting the main loop will not do any good since there is no loop to quit from.</p>
  
  <p>Even so, <code>gtk.main_level()</code> returns 0. Moreover, when I try <code>gtk.main()</code> from the python command line, it hangs as well. There is something basic I am missing, so can anybody point me to it? Appreciated.</p>
  
  <p>EDIT:
  The Gtk method I need is <code>gobject.add_timeout</code>, like this:</p>
  
  <pre><code>gobject.timeout_add(2000, callback)
  gtk.main() # This blocks the thread.
  </code></pre>