I have created a wx.grid.Grid with a wx.grid.PyGridTableBase derived class to provide its data. I want to also to control the editors used on the table. Towards that end I defined the following method
def GetAttr(self, row, col, kind):
attr = wx.grid.GridCellAttr()
if col == 0:
attr.SetEditor( wx.grid.GridCellChoiceEditor() )
return attr
However, this causes a segmentation fault whenever I attempt to created the editor in the grid. I did try creating the editor beforehand and passing it in as a parameter but received the error:
TypeError: in method 'GridCellAttr_SetEditor', expected argument 2 of type
'wxGridCellEditor *'
I suspect the second error is caused by the GridCellAttr taking ownership off and then destroying my editor.
I also tried using the SetDefaultEditor method on the wx.grid.Grid and that works, but naturally does not allow me to have a column specific editing strategy.
See Full Example of crashing program: http://pastebin.com/SEbhvaKf