dabo Commit
Revision 1281
Date: 2005-09-09 09:05:08 -0700 (Fri, 09 Sep 2005)
Author: paul
Changed:
U trunk/dabo/ui/uiwx/dGrid.py
Log:
This removes the error when running dGrid.py, but doesn't solve the
underlying problem yet.
Diff:
Modified: trunk/dabo/ui/uiwx/dGrid.py
===================================================================
--- trunk/dabo/ui/uiwx/dGrid.py 2005-09-09 15:42:52 UTC (rev 1280)
+++ trunk/dabo/ui/uiwx/dGrid.py 2005-09-09 16:05:08 UTC (rev 1281)
@@ -83,7 +83,13 @@
dabo.infoLog.write("dGrid.Table.GetAttr:: kind is not
0, it is %s." % kind)
## The column attr object is maintained in dColumn:
- return self.grid.Columns[col]._gridColAttr.Clone()
+ try:
+ return self.grid.Columns[col]._gridColAttr.Clone()
+ except IndexError:
+ # Something is out of order in the setting up of the
grid: the grid table
+ # has columns, but self.grid.Columns doesn't know about
it yet. Just return
+ # the default:
+ return self.grid._defaultGridColAttr.Clone()
def GetRowLabelValue(self, row):
try:
@@ -423,7 +429,7 @@
self.canIncrSearch = True
# dColumn maintains one attr object that the grid table will
use:
- self._gridColAttr = wx.grid.GridCellAttr()
+ self._gridColAttr = self.Parent._defaultGridColAttr.Clone()
self._afterInit()
def _constructed(self):
@@ -664,6 +670,9 @@
# List of Row Labels, if any
self._rowLabels = []
+ # dColumn maintains its own cell attribute object, but this is
the default:
+ self._defaultGridColAttr = wx.grid.GridCellAttr()
+
# Columns notify the grid when their properties change
# Sometimes the grid itself initiated the change, and doesn't
# need to be notified.
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev