dabo Commit
Revision 6429
Date: 2011-02-12 08:51:17 -0800 (Sat, 12 Feb 2011)
Author: Ed
Trac: http://trac.dabodev.com/changeset/6429

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

Log:
Added the getContainingWindow() method that will return the window that 
contains the sizer, even if the sizer is nested within other sizers.

Diff:
Modified: trunk/dabo/ui/uiwx/dSizerMixin.py
===================================================================
--- trunk/dabo/ui/uiwx/dSizerMixin.py   2011-02-12 16:49:43 UTC (rev 6428)
+++ trunk/dabo/ui/uiwx/dSizerMixin.py   2011-02-12 16:51:17 UTC (rev 6429)
@@ -507,6 +507,17 @@
                return ret
 
 
+       @dabo.ui.deadCheck
+       def getContainingWindow(self):
+               """Return the window that contains this sizer. In the case of 
nested
+               sizers, traverse the parent hierarchy until a window is reached.
+               """
+               ret = self.Parent
+               while ret and isinstance(ret, dSizerMixin):
+                       ret = ret.Parent
+               return ret
+
+
        def _resolveOutlineSettings(self):
                if self.outlineColor is None:
                        if self.Orientation == "Vertical":



_______________________________________________
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