dabo Commit
Revision 4219
Date: 2008-06-30 20:22:36 -0700 (Mon, 30 Jun 2008)
Author: Ed
Trac: http://svn.dabodev.com/trac/dabo/changeset/4219
Changed:
U trunk/dabo/ui/uiwx/dGrid.py
Log:
Fixed a problem when using columns with a 'list' data type reported by Adrian
Klaver.
Also fixed a bug in the removeColumn() method that didn't correctly trap a
missing column.
Diff:
Modified: trunk/dabo/ui/uiwx/dGrid.py
===================================================================
--- trunk/dabo/ui/uiwx/dGrid.py 2008-07-01 02:50:37 UTC (rev 4218)
+++ trunk/dabo/ui/uiwx/dGrid.py 2008-07-01 03:22:36 UTC (rev 4219)
@@ -973,9 +973,10 @@
def _setDataField(self, val):
if self._constructed():
+ if self._dataField:
+ # Use a callAfter, since the parent may not be
finished instantiating yet.
+
dabo.ui.callAfter(self._setDataTypeFromDataField, val)
self._dataField = val
- # Use a callAfter, since the parent may not be finished
instantiating yet.
- dabo.ui.callAfter(self._setDataTypeFromDataField, val)
if not self.Name or self.Name == "?":
self._name = _("col_%s") % val
self._updateRenderer()
@@ -2958,10 +2959,10 @@
colNum = col
else:
# They probably passed a specific column instance
- colNum = self.Columns.index(col)
- if colNum == -1:
- # No such column
- # raise an error?
+ try:
+ colNum = self.Columns.index(col)
+ except ValueError:
+ # Column is not in the grid
return
del self.Columns[colNum]
self._syncColumnCount()
_______________________________________________
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]