Python - wxGrid.DeleteCols():分段错误

时间:2012-10-29 10:29:50

标签: python wxpython segmentation-fault

我正在使用xyPython,特别是wx.Grid,当我尝试从网格中删除列时程序崩溃,终端显示“分段错误”

dataGrid.CreateGrid(30, 20)

...

dataGrid.DeleteCols()

这几乎就是代码。我可以删除行,而不是列。 如果我删除删除列行,它可以正常工作。

2 个答案:

答案 0 :(得分:0)

根据以下主题,您可能必须自己设置列标签,否则可能会出错:

https://groups.google.com/forum/?fromgroups=#!topic/wxpython-users/IpARv4wVoqw

然后在这个新线程中,据说您可能需要致电IncRef:https://groups.google.com/forum/?fromgroups=#!topic/wxpython-users/I1kndNvIEEQ

答案 1 :(得分:0)

http://www.wxpython.org/docs/api/wx.grid.Grid-class.html

DeleteCols(self, pos, numCols, updateLabels)

的参数