dabo Commit
Revision 2173
Date: 2006-05-21 08:31:34 -0700 (Sun, 21 May 2006)
Author: ed

Changed:
U   trunk/dabo/ui/uiwx/dMenuBar.py

Log:
Added protective code to insertMenu() in case an out-of-range value for 
position is passed.


Diff:
Modified: trunk/dabo/ui/uiwx/dMenuBar.py
===================================================================
--- trunk/dabo/ui/uiwx/dMenuBar.py      2006-05-21 03:17:28 UTC (rev 2172)
+++ trunk/dabo/ui/uiwx/dMenuBar.py      2006-05-21 15:31:34 UTC (rev 2173)
@@ -46,6 +46,7 @@
 
        def insertMenu(self, pos, menu):
                """Inserts a dMenu in the dMenuBar at the specified position."""
+               pos = min(pos, self.GetMenuCount())
                ret = self.Insert(pos, menu, menu.Caption)
                if ret:
                        menu.Parent = self




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev

Reply via email to