Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import wx.grid
- app = wx.PySimpleApp()
- class Source(wx.grid.PyGridTableBase):
- def IsEmptyCell(self, row, col):
- return False
- def GetCellValue(self, row, col):
- return repr( (row, col) )
- def SetCellValue(self, row, col, value):
- pass
- def GetNumberRows(self):
- return 5
- def GetNumberCols(self):
- return 5
- def GetAttr(self, row, col, kind):
- attr = wx.grid.GridCellAttr()
- attr.SetEditor( wx.grid.GridCellChoiceEditor() )
- return attr
- frame = wx.Frame(None)
- grid = wx.grid.Grid(frame)
- grid.SetTable( Source() )
- frame.Show()
- app.MainLoop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement