Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def _find(self, text):
- # Used for debugging, searches the object tree for the first
- # item containing the given text
- self.found = None
- self._walk(self.app, text)
- print('Found: ')
- print(self.found)
- print(self.found.get_properties())
- def _walk(self, gtk_object, text):
- if self.found:
- return
- prop = '%s' % gtk_object.get_properties()
- if text in prop:
- self.found = gtk_object
- print "Searching through %s children" % len(gtk_object.get_children())
- for c in gtk_object.get_children():
- print "Checking %s" % c
- if str(c).index("GtkWindow"):
- print "Walking %s" % c
- self._walk(c, text)
- else:
- print "Returning %s" % c
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement