title: GObject.idle_add(func), my program hangs
body: <p>I don't know why my program hangs, I've already read several topics about this.</p>
  
  <p>The result is that when i <strong>click on Config_Window_Button1</strong>, then my <strong>Config_Window freezes</strong> for a while, <strong>the time requested by <code>time.sleep()</code></strong>. </p>
  
  <p>Then Network_Window appears but <strong><code>GObject.idle_add()</code> seems to being run just one time</strong> (the fraction is adjusted to 0.25); i can't see any movement in that progressbar, and the point of interest is that <strong>the <code>print("def pulse running")</code> is regularly running</strong>.</p>
  
  <p>So:</p>
  
  <p><strong>1)</strong> <em>why Config_Window freezes for S seconds, where time.sleep(S) is after GObject.idle_add()?</em></p>
  
  <p><strong>2)</strong> <em>why my GUI hasn't being updated?</em></p>
  
  <pre><code>GObject.threads_init()
  builder = Gtk.Builder()
  builder.add_from_file('UI2.glade')
  builder.get_object('Config_Window').show()
  
  progressbar = builder.get_object('Progressbar1')
  progressbar.set_inverted(True)
  fraction = 0.0
  builder.get_object('Config_Window_Button1').connect('clicked', collega_GUI) 
  
  
  def collega_GUI(widget, args=()):
  
      builder.get_object('boxNetwork').show_all()
      builder.get_object('Network_Window').show()
      progressbar.set_pulse_step(0.25)
  
      pulse()
      print 'collega_GUI has ended'
  
  
  def pulse():
  
      while True:
          GObject.idle_add(progressbar.pulse)
          time.sleep(1)
          print 'def pulse running'
  </code></pre>