Populates the View tree.
(self, view)
| 644 | self.viewDetails.set(view) |
| 645 | |
| 646 | def populateViewTree(self, view): |
| 647 | ''' |
| 648 | Populates the View tree. |
| 649 | ''' |
| 650 | |
| 651 | print('culebron.populateViewTree: getting unique id for %s' % view.__class__.__name__, file=sys.stderr) |
| 652 | if type(view) == WindowHierarchy: |
| 653 | print('culebron.populateViewTree: skipping HierarchyView', file=sys.stderr) |
| 654 | return |
| 655 | else: |
| 656 | print('culebron.populateViewTree: %s' % type(view), file=sys.stderr) |
| 657 | |
| 658 | parent_unique_id = '' |
| 659 | try: |
| 660 | vuid = view.getUniqueId() |
| 661 | text = view.__smallStr__() |
| 662 | parent = view.getParent() |
| 663 | is_target = view.isTarget() |
| 664 | if parent: |
| 665 | parent_unique_id = parent.getUniqueId() |
| 666 | except AttributeError: |
| 667 | vuid = view.unique_id |
| 668 | # FIXME |
| 669 | # is_target = view.is_target |
| 670 | is_target = False |
| 671 | text = view.text |
| 672 | parent = view.parent |
| 673 | if parent: |
| 674 | # FIXME: |
| 675 | # parent is an int |
| 676 | # parent_unique_id = parent.unique_id |
| 677 | parent_unique_id = 0 |
| 678 | if parent is None: |
| 679 | self.viewTree.insert('', tkinter.END, vuid, text=text) |
| 680 | else: |
| 681 | self.viewTree.insert(parent_unique_id, tkinter.END, vuid, text=text, tags=('ttk')) |
| 682 | self.viewTree.set(vuid, 'T', '*' if is_target else ' ') |
| 683 | self.viewTree.tag_bind('ttk', '<1>', self.viewTreeItemClicked) |
| 684 | |
| 685 | def findTargets(self): |
| 686 | ''' |
nothing calls this directly
no test coverage detected