dabo Commit
Revision 4948
Date: 2009-01-21 19:57:24 -0800 (Wed, 21 Jan 2009)
Author: Ed
Trac: http://trac.dabodev.com/changeset/4948

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

Log:
Updated getMenuIndex() to use IDs if available.


Diff:
Modified: trunk/dabo/ui/uiwx/dMenuBar.py
===================================================================
--- trunk/dabo/ui/uiwx/dMenuBar.py      2009-01-22 03:21:20 UTC (rev 4947)
+++ trunk/dabo/ui/uiwx/dMenuBar.py      2009-01-22 03:57:24 UTC (rev 4948)
@@ -140,19 +140,20 @@
                except IndexError:
                        ret = None
                        # Try the Caption
-                       idx = self.getMenuIndex(idOrCaption)
-                       if idx is not None:
+                       idx = self.FindMenu(idOrCaption)
+                       if idx > 0:
                                ret = self.GetMenu(idx)
                return ret
 
 
-       def getMenuIndex(self, caption):
-               """Returns the index of the menu with the specified caption.
-
+       def getMenuIndex(self, idOrCaption):
+               """Returns the index of the menu with the specified ID or 
caption.
                If the menu isn't found, None is returned.
                """
-               ret = self.FindMenu(caption)
-               if ret < 0:
+               mn = self.getMenu(idOrCaption)
+               if mn:
+                       ret = self.Children.index(mn)
+               else:
                        ret = None
                return ret
 



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to