dabo Commit
Revision 5893
Date: 2010-06-17 13:21:30 -0700 (Thu, 17 Jun 2010)
Author: Paul
Trac: http://trac.dabodev.com/changeset/5893
Changed:
U trunk/dabo/ui/uiwx/dGrid.py
Log:
I've gotten a few reports of IndexErrors on self.Columns[col]: index out of
range.
So it's possible for this event to fire before the dabo column objects are set
up.
Added code to return immediately if this is the case. Not sure if we should also
call evt.Veto() first or not.
Diff:
Modified: trunk/dabo/ui/uiwx/dGrid.py
===================================================================
--- trunk/dabo/ui/uiwx/dGrid.py 2010-06-16 19:50:24 UTC (rev 5892)
+++ trunk/dabo/ui/uiwx/dGrid.py 2010-06-17 20:21:30 UTC (rev 5893)
@@ -3665,11 +3665,18 @@
def __onWxGridColSize(self, evt):
col = evt.GetRowOrCol()
- if self.ResizableColumns and self.Columns[col].Resizable:
+ try:
+ daboCol = self.Columns[col]
+ except IndexError:
+ # PKM: I've received an IndexError from one of my
customers. Not sure what the
+ # sequence is, but perhaps they managed to resize
the column *before* the
+ # grid was instantiated.
+ return
+ if self.ResizableColumns and daboCol.Resizable:
self.raiseEvent(dEvents.GridColSize, evt)
else:
# need to reference the Width property for some reason:
- self.Columns[col].Width
+ daboCol.Width
evt.Veto()
self._refreshHeader()
_______________________________________________
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]