TypeError: in method 'GridCellAttr_SetEditor', expected argument 2 of type 'wxGridCellEditor *'

Since you are reusing the same editor object you need to call its IncRef() method each time you use it with a new cell attr object.

P.S. Next time please attach your sample code to an email instead of pasting it in to the body of the message, so lines are not improperly wrapped or indentation messed up.

···

On 4/11/11 3:52 PM, David LePage wrote:

Hi all,

I'm hoping for some advice. I am getting the above error in my wx.grid after
deleting a row and attempting to re-add a new one.

I've attached some example code that shows the problem.
In short, if I launch the program and click the "Add" button below the grid, a
new row is displayed with a GridCellEditor in column 0 for each new row added.

If I set up a bind method to allow the user to right click on the row number, it
allows them to delete that row. That works properly.

However, when I then click Add to add a new row, the GridCellEditor call fails.
I'm assuming I should have to somehow refresh the reference to the celleditor
but can't figure out how to do that.

--
Robin Dunn
Software Craftsman