title: Python: Entry Window sometimes will not die
body: <p>I have this odd intermittent problem with a popup dialog that requests the user to enter a URL and press enter. Roughly half of the time, there is no response to the user pressing Enter. It can happen twice in a row for the same entered data and then work the third time with the same input. Restarting the application doesn't really alter much with the behaviour. I'm trying to debug it with breakpoints and watches using PyCharm but I can't get it to step into the functions properly.</p>
  
  <p>The two functions which manage the user input are as follows:</p>
  
  <pre><code>def on_click_pic(self, button, null):
      self.url_win = Gtk.Window()
      self.url_win.set_default_size(500,20)
      self.url_win.set_border_width(10)
      self.url_win.set_title("Enter a URL for the player photo")
      self.url_win.add(self.url_entry)
      self.url_win.show_all()
  
  def on_url_enter(self, event):
      search = self.url_entry.get_text()
      self.url_win.destroy()
      print "getting image: %s " % search
      self.get_image(search, self.e_image)
      self.e_pic = search
      print "e_pic set to %s" % search
  </code></pre>
  
  <p>The first function is triggered when the user clicks on a GTKImage pinned to an Event Box. This part always works. The second one is activated by the connect of the entry box which is called in the main by</p>
  
  <pre><code>self.url_entry.connect("activate", self.on_url_enter)
  </code></pre>
  
  <p>It's as though this connect function is only called about half the time as on_url_enter does not appear to run the rest of the time. I've tried checking my steps to see does the entry box lose focus but there's no patter to it. Is there anything else I should be looking for or is there a more reliable way to code this, maybe by making a modal class of the entry box?</p>