我需要帮助从我的ObjectListView中删除交替的颜色。
self.problist = ObjectListView(self, -1, style=wx.LC_REPORT|wx.SUNKEN_BORDER)
self.problist.SetColumns([
ColumnDefn("Problem", "left", 400, valueGetter="short_des"),
ColumnDefn("First Treated", "left", 100, valueGetter="prob_date"),
ColumnDefn("ICD-10 Code", "left", 100, valueGetter="icd10")
])
self.problist.SetObjects(problems)
self.problist.cellEditMode = ObjectListView.CELLEDIT_DOUBLECLICK
self.problist.Bind(EVT_CELL_EDIT_STARTING, self.HandleCellEditStarting)
self.problist.Bind(EVT_CELL_EDIT_FINISHED, self.HandleCellEditFinished)
self.problist.rowFormatter = self.rowFormatter
self.problist.useAlternateBackColors = False
我也试过self.problist.useAlternateBackColors(False)
。这被自动设置为True。在搜索了文档之后,我没有找到关于如何设置这个ObjectListView属性的任何指示。
谢谢
需要在加载对象之前设置。
self.problist = ObjectListView(self, -1, style=wx.LC_REPORT|wx.SUNKEN_BORDER)
self.problist.SetColumns([
ColumnDefn("Problem", "left", 400, valueGetter="short_des"),
ColumnDefn("First Treated", "left", 100, valueGetter="prob_date"),
ColumnDefn("ICD-10 Code", "left", 100, valueGetter="icd10")
])
self.problist.useAlternateBackColors = False
self.problist.SetObjects(problems)
self.problist.cellEditMode = ObjectListView.CELLEDIT_DOUBLECLICK
self.problist.Bind(EVT_CELL_EDIT_STARTING, self.HandleCellEditStarting)
self.problist.Bind(EVT_CELL_EDIT_FINISHED, self.HandleCellEditFinished)
self.problist.rowFormatter = self.rowFormatter