Rich Shepard
2008-05-30 16:20:35 UTC
I'm really puzzled because my code is not working as expected. In the
method I'm debugging are these lines:
self.dataGrid.ClearGrid()
nRows = self.table.GetNumberRows()
self.dataGrid.AppendRows(nRows - 1)
self.dataGrid.ForceRefresh()
When I walk through the method using winpdb, nRows is correctly assigned
the value of 114. (The grid is initialized with 1 row.) However, nothing
happens when 'self.dataGrid.AppendRows(nRows - 1)' is executed; therefore,
there's nothing to refresh.
Because the data are managed by a grid table, in the class
dataTable(wx.grid.PyGridTableBase) I created a method to approve the
addition of rows to the display grid:
def AppendRows(self, numRows=1):
return self.GetNumberRows() - 1
There must be something wrong with my syntax in either or both of these
two methods, but I cannot find the error(s) from the book or online docs. A
clue is appreciated.
Rich
method I'm debugging are these lines:
self.dataGrid.ClearGrid()
nRows = self.table.GetNumberRows()
self.dataGrid.AppendRows(nRows - 1)
self.dataGrid.ForceRefresh()
When I walk through the method using winpdb, nRows is correctly assigned
the value of 114. (The grid is initialized with 1 row.) However, nothing
happens when 'self.dataGrid.AppendRows(nRows - 1)' is executed; therefore,
there's nothing to refresh.
Because the data are managed by a grid table, in the class
dataTable(wx.grid.PyGridTableBase) I created a method to approve the
addition of rows to the display grid:
def AppendRows(self, numRows=1):
return self.GetNumberRows() - 1
There must be something wrong with my syntax in either or both of these
two methods, but I cannot find the error(s) from the book or online docs. A
clue is appreciated.
Rich
--
Richard B. Shepard, Ph.D. | Integrity Credibility
Applied Ecosystem Services, Inc. | Innovation
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
Richard B. Shepard, Ph.D. | Integrity Credibility
Applied Ecosystem Services, Inc. | Innovation
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863