问题:
wx._core.wxAssertionError: C++ assertion “m_count > 0” failed at …\src\common\object.cpp(352) in wxRefCounter::DecRef(): invalid ref data count
出现问题的原因:
attr = wx.grid.GridCellAttr()
for i in range(len(lis)):
editor = wx.grid.GridCellBoolEditor()
self.SetCellEditor(i + 1, 0, editor)
self.SetCellRenderer(i + 1, 0, wx.grid.GridCellBoolRenderer())
for j in range(len(lis[i])):
self.SetCellValue(i + 1, j + 1, lis[i][j])
attr.SetReadOnly()
self.SetAttr(i + 1, j + 1, attr)
解决方案一:
#attr = wx.grid.GridCellAttr() #修改部分
for i in range(len(list1)):
attr = wx.grid.GridCellAttr()#修改部分
self.SetCellValue(i + 1, j + 1, list1[i][j])
attr.SetRea