'In wxPython, Grid.GridCellBoolEditor() always return empty string
Here is my code:
class CustomGrid(grid.Grid):
def __init__(self, parent):
gridlib.Grid.__init__(self, parent, pos=wx.DefaultPosition, size=wx.Size(-1, 580))
self.CreateGrid(1, 7)
self.SetRowLabelSize(200)
self.SetRowLabelAlignment(wx.ALIGN_LEFT, wx.ALIGN_CENTER)
self.SetColLabelAlignment(wx.ALIGN_CENTER, wx.ALIGN_CENTER)
# self.SetCellHighlightPenWidth(0)
# self.SetCellHighlightROPenWidth(0)
days = weekDaysFr()
for (k, day) in days.items():
self.SetColLabelValue(k, day)
self.SetCellRenderer(0, 0, grid.GridCellBoolRenderer())
self.SetCellEditor(0, 0, grid.GridCellBoolEditor())
self.SetCellValue(0, 0, '0')
self.SetCellAlignment(0, 0, wx.ALIGN_CENTRE, wx.ALIGN_CENTRE)
self.Bind(gridlib.EVT_GRID_CELL_LEFT_CLICK, self.onGridCellClick)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
