- treeObj = xxx.treeObject()
- if treeObj.className not in ['wxFrame', 'wxPanel', 'wxDialog',
- 'wxMenuBar', 'wxToolBar', 'wxWizard',
- 'wxWizardPageSimple']:
+ availableViews = ['wxFrame', 'wxPanel', 'wxDialog',
+ 'wxMenuBar', 'wxToolBar', 'wxWizard',
+ 'wxWizardPageSimple']
+ originalItem = item
+ # Walk up the tree until we find an item that has a view
+ while item and self.GetPyData(item).treeObject().className not in availableViews:
+ item = self.GetItemParent(item)
+ if not item or not item.IsOk():