dabo Commit
Revision 2475
Date: 2006-11-18 00:03:53 -0800 (Sat, 18 Nov 2006)
Author: paul

Changed:
U   branches/wx2.7/dabo/ui/uiwx/dPemMixin.py
U   branches/wx2.7/dabo/ui/uiwx/dSizerMixin.py

Log:
These changes seem to work around the problems with Destroy() that happened
with the reordering of the class definitions for wxPython 2.7. Now we need
to test all the apps with this branch with both wxPython 2.6 and 2.7.


Diff:
Modified: branches/wx2.7/dabo/ui/uiwx/dPemMixin.py
===================================================================
--- branches/wx2.7/dabo/ui/uiwx/dPemMixin.py    2006-11-18 07:57:58 UTC (rev 
2474)
+++ branches/wx2.7/dabo/ui/uiwx/dPemMixin.py    2006-11-18 08:03:53 UTC (rev 
2475)
@@ -174,7 +174,7 @@
                # _afterInit() will call the afterInit() user hook
                self._afterInit()
 
-               super(dPemMixin, self).__init__()
+               dPemMixinBase.__init__(self)  ## don't use super(), or wx init 
called 2x.
 
                if dabo.fastNameSet:
                        # Event AutoBinding is set to happen when the Name 
property changes, but
@@ -360,6 +360,16 @@
                self.initEvents()
 
 
+       def Destroy(self, *args, **kwargs):
+               # wxPython 2.7 bug workaround:
+               try:
+                       super(dPemMixin, self).Destroy(*args, **kwargs)
+                       # Most of the Destroy phase happened before the 
TypeError occurred.
+                       # Enough, it seems, to be able to pass without worrying 
too much.
+                       # (wxPython2.7.2)
+               except TypeError:
+                       pass
+
        def __onMouseEnter(self, evt):
                if self._hover:
                        if self._hoverTimer is None:
@@ -1063,7 +1073,7 @@
 
        def __onUpdate(self, evt):
                """Update any dynamic properties, and then call the refresh() 
hook."""
-               if isinstance(self, dabo.ui.deadObject):
+               if isinstance(self, dabo.ui.deadObject) or not 
self._constructed():
                        return
                self.update()
                        

Modified: branches/wx2.7/dabo/ui/uiwx/dSizerMixin.py
===================================================================
--- branches/wx2.7/dabo/ui/uiwx/dSizerMixin.py  2006-11-18 07:57:58 UTC (rev 
2474)
+++ branches/wx2.7/dabo/ui/uiwx/dSizerMixin.py  2006-11-18 08:03:53 UTC (rev 
2475)
@@ -256,7 +256,10 @@
                # Release this sizer
                if isinstance(self, dabo.ui.dBorderSizer):
                        dabo.ui.callAfter(self.Box.release)
-               self.Destroy()
+               try:
+                       self.Destroy()
+               except TypeError:
+                       pass
        
        
        def getPositionInSizer(self):




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

Reply via email to