dabo Commit
Revision 5537
Date: 2009-11-29 17:38:18 -0800 (Sun, 29 Nov 2009)
Author: Ed
Trac: http://trac.dabodev.com/changeset/5537

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

Log:
Updated the code for determining position of an object in the grid sizer

Diff:
Modified: trunk/dabo/ui/uiwx/dGridSizer.py
===================================================================
--- trunk/dabo/ui/uiwx/dGridSizer.py    2009-11-28 17:14:22 UTC (rev 5536)
+++ trunk/dabo/ui/uiwx/dGridSizer.py    2009-11-30 01:38:18 UTC (rev 5537)
@@ -296,15 +296,12 @@
                sizer, returns a (row,col) tuple for that item's location.
                """
                if isinstance(obj, self.SizerItem):
-                       szit = obj
+                       # Two of these will return None and one will return the 
actual object
+                       # The line below will return the one that is not None.
+                       itm = obj.GetWindow() or obj.GetSpacer() or 
obj.GetSizer()
                else:
-                       szit = obj.ControllingSizerItem
-               try:
-                       row, col = szit.GetPos()
-               except (wx.PyAssertionError, AttributeError):
-                       # Window isn't controlled by this sizer
-                       row, col = None, None
-               return (row, col)
+                       itm = obj
+               return self.GetItemPosition(itm).Get()
 
 
        def getGridSpan(self, obj):



_______________________________________________
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