def get_child_by_name(parent, name):
<EOL>def iterate_children(widget, name):<EOL><INDENT>if widget.get_name() == name:<EOL><INDENT>return widget<EOL><DEDENT>try:<EOL><INDENT>for w in widget.get_children():<EOL><INDENT>result = iterate_children(w, name)<EOL>if result is not None:<EOL><INDENT>return result<EOL><DEDENT>else:<EOL><INDENT>continue<EOL><DEDENT><DEDENT><DEDENT>except AttributeError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>return iterate_children(parent, name)<EOL>
Iterate through a gtk container, `parent`,
and return the widget with the name `name`.