diff --git a/wxPython/wx/tools/XRCed/tree.py b/wxPython/wx/tools/XRCed/tree.py index 6719d5c507..f11aa795c8 100644 --- a/wxPython/wx/tools/XRCed/tree.py +++ b/wxPython/wx/tools/XRCed/tree.py @@ -630,8 +630,11 @@ class XML_Tree(wxTreeCtrl): # Top-level sizer? return window's sizer if xxx.isSizer and isinstance(parentWin, wxWindow): return parentWin.GetSizer() + elif isinstance(xxx, xxxToolBar): + # If it's the main toolbar, we can't really select it + if xxx.parent.__class__ == xxxFrame: return None elif isinstance(xxx.parent, xxxToolBar): - # How to get tool from toolbar? + # Select complete toolbar return parentWin elif isinstance(xxx.parent, xxxStdDialogButtonSizer): # This sizer returns non-existing children