dabo Commit
Revision 6661
Date: 2011-07-04 04:59:06 -0700 (Mon, 04 Jul 2011)
Author: Ed
Trac: http://trac.dabodev.com/changeset/6661
Changed:
U trunk/dabo/ui/uiwx/dPemMixin.py
Log:
Draw routines could be invoked while in the process of drawing; this fixes
those unneeded calls.
Diff:
Modified: trunk/dabo/ui/uiwx/dPemMixin.py
===================================================================
--- trunk/dabo/ui/uiwx/dPemMixin.py 2011-07-04 11:54:02 UTC (rev 6660)
+++ trunk/dabo/ui/uiwx/dPemMixin.py 2011-07-04 11:59:06 UTC (rev 6661)
@@ -264,6 +264,7 @@
self._name = "?"
self._pemObject = pre
self._needRedraw = True
+ self._inRedraw = False
self._borderColor = (0, 0, 0)
self._borderWidth = 0
self._borderLineStyle = "Solid"
@@ -699,7 +700,13 @@
def __onWxPaint(self, evt):
if self._finito:
return
- self._needRedraw = bool(self._drawnObjects)
+# def __setNeedRedraw():
+# try:
+# self._needRedraw = bool(self._drawnObjects)
+# except dabo.ui.deadObjectException:
+# pass
+# dabo.ui.callAfterInterval(50, __setNeedRedraw)
+ self._needRedraw = (not self._inRedraw) and
bool(self._drawnObjects)
self.raiseEvent(dEvents.Paint, evt)
@@ -1668,6 +1675,9 @@
method is where they go. Subclasses should place code in the
redraw() hook method.
"""
+ if self._inRedraw:
+ return
+ self._inRedraw = True
# Clear the idle flag.
self._needRedraw = False
if dc is None:
@@ -1680,6 +1690,10 @@
obj.draw(dc)
# Call the hook
self.redraw(dc)
+ # Make sure this is really cleared.
+ self._needRedraw = False
+ # Clear the process flag
+ self._inRedraw = False
def redraw(self, dc):
@@ -1871,6 +1885,8 @@
self.SetBackgroundColour(val)
# Background color changes don't result
in an automatic refresh.
self.refresh()
+ elif val is None:
+ self.SetBackgroundColour(wx.NullColour)
else:
self._properties["BackColor"] = val
_______________________________________________
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]