1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
--- MainORM.py  2013-06-24 22:19:26.343298892 -0700
+++ /tmp/MainORM.py 2013-06-24 22:19:16.091248053 -0700
@@ -1007,9 +1007,10 @@
         # Show how to get a custom minimizing behaviour, i.e., to minimize a pane
         # inside an existing AuiToolBar
         tree = self._mgr.GetPane("test8")
-        tree.MinimizeMode(aui.AUI_MINIMIZE_POS_TOOLBAR)
-        toolbarPane = self._mgr.GetPane(tb4)
-        tree.MinimizeTarget(toolbarPane)
+        if hasattr(aui, 'AUI_MINIMIZE_POS_TOOLBAR'):
+            tree.MinimizeMode(aui.AUI_MINIMIZE_POS_TOOLBAR)
+            toolbarPane = self._mgr.GetPane(tb4)
+            tree.MinimizeTarget(toolbarPane)

         # "commit" all changes made to AuiManager
         self._mgr.Update()
@@ -1436,6 +1437,9 @@
             while True:
                 if self.tree.ItemHasChildren(root):
                     (child, cookie) = self.tree.GetFirstChild(root)
+                    if not child.IsOk():
+                      break
+
                     key = self.tree.GetPyData(child)
                     if key not in keys:  # shouldn't be in tree
                         self.tree.Delete(child)