It always seems presumptuous when someone jumps out saying "Python has a bug!" Invariably it turns out to be the guy reporting the so-called bug is the one doing it wrong. In this case I believe it might be a documentation bug/issue, but I'll let you guys decide.
I was recently wanting to set the attributes of a single cell inside a wxGrid. I attempted to do so using:
self.SetAttr(myAttr, row, col)
only I kept getting an error:
TimesheetEntryCellEditor init
Traceback (most recent call last):
File "/home/cooperg/quickbooks/gui/TimesheetGrid.py", line 179, in OnCellChange
self.SetAttr(entryAttr, evt.GetRow(), col,)
File "/usr/lib/python2.3/site-packages/wxPython/grid.py", line 1256, in SetAttr
val = gridc.wxGrid_SetAttr(self, *_args, **_kwargs)
AttributeError: wxGridCellAttr instance has no attribute '__int__'
It turns out that these pages:
http://search.cpan.org/src/MBARBON/Wx-0.18/ext/grid/XS/GridTable.xsp
http://wiki.wxpython.org/index.cgi/wxPyGridTableBase
are -- it would seem -- incorrect in regard to the order of the attributes. They claim the parameter order is:
SetAttr(wxGridCellAttr* attr, int row, int col)
But it appears that the parameter order is:
SetAttr(int row, int col, wxGridCellAttr* attr)
Or at least that's the order I had to send it in to get it to work.
Not that the python help() function worked for anything the only thing it tells you is to send *args, **kwargs. Right... *thanks!*
=]