dabo Commit
Revision 6344
Date: 2011-01-25 02:08:45 -0800 (Tue, 25 Jan 2011)
Author: Jacekk
Trac: http://trac.dabodev.com/changeset/6344

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

Log:
Fix _paintHeader() issue if it's called from outside of the OnPaint event.

Diff:
Modified: trunk/dabo/ui/uiwx/dGrid.py
===================================================================
--- trunk/dabo/ui/uiwx/dGrid.py 2011-01-25 09:51:12 UTC (rev 6343)
+++ trunk/dabo/ui/uiwx/dGrid.py 2011-01-25 10:08:45 UTC (rev 6344)
@@ -2530,7 +2530,11 @@
                w = self._getWxHeader()
                if updateBox is None:
                        updateBox = w.GetClientRect()
-               dc = wx.PaintDC(w)
+               try:
+                       # When called from OnPaint event, there should be 
PaintDC context.
+                       dc = wx.PaintDC(w)
+               except wx.PyAssertionError:
+                       dc = wx.ClientDC(w)
                textAngle = {True: 90, False: 0}[self.VerticalHeaders]
                self._columnMetrics = []
 



_______________________________________________
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