generictable.py

来自「wxPython的基本示例程序」· Python 代码 · 共 35 行

PY
35
字号
import wximport wx.gridclass GenericTable(wx.grid.PyGridTableBase):                def __init__(self, data, rowLabels=None, colLabels=None):        wx.grid.PyGridTableBase.__init__(self)        self.data = data        self.rowLabels = rowLabels        self.colLabels = colLabels            def GetNumberRows(self):        return len(self.data)    def GetNumberCols(self):        return len(self.data[0])    def GetColLabelValue(self, col):        if self.colLabels:            return self.colLabels[col]            def GetRowLabelValue(self, row):        if self.rowLabels:            return self.rowLabels[row]            def IsEmptyCell(self, row, col):        return False    def GetValue(self, row, col):        return self.data[row][col]    def SetValue(self, row, col, value):        pass         

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?