title: pygtk get widget by name from parent node
body: <p>I have a gtk widget and I want to find out if within its descendants there is another widget.  If there is one, I want to return it otherwise return None.  This is a simple recursive problem but I cannot seem to get the right method to do it. </p>
  
  <p>In the glade xml file, I have:</p>
  
  <pre><code>  &lt;object class="GtkDialog" id="monkey"&gt;
    [...]
         &lt;object class="GtkTreeView" id="ook"&gt;
  </code></pre>
  
  <p>and a call to <code>find(my_monkey_object, 'ook')</code> should return the GtkTreeView object.
  <code>find()</code> should be something akin to</p>
  
  <pre><code>def find (node, id):
      if node.XXX() == id: return node
      for child in node.get_children():
          ret = find(child, id)
          if ret: return ret
      return None
  </code></pre>
  
  <p>I am not sure which XXX() method I need to use.  <code>get_name()</code> looked hopeful but returns the class name of the object and not its "id".  The version I use is pygtk-2.24. </p>
  
  <p>See this <a href="https://stackoverflow.com/questions/3489520/python-gtk-widget-name">Python GTK+ widget name</a> question for the same problem.</p>
  
  <p>Note that this <a href="https://bugzilla.gnome.org/show_bug.cgi?id=591085" rel="nofollow noreferrer">bug</a> kind of explains the issue:  I want the builder ID as from a GTK widget tree.  Sadly, this seems impossible to get...</p>