Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2010
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.64 KB | None | 0 0
  1. import wx.grid
  2.  
  3. app = wx.PySimpleApp()
  4.  
  5. class Source(wx.grid.PyGridTableBase):
  6.     def IsEmptyCell(self, row, col):
  7.         return False
  8.  
  9.     def GetCellValue(self, row, col):
  10.         return repr( (row, col) )
  11.  
  12.     def SetCellValue(self, row, col, value):
  13.         pass
  14.  
  15.     def GetNumberRows(self):
  16.         return 5
  17.  
  18.     def GetNumberCols(self):
  19.         return 5
  20.  
  21.     def GetAttr(self, row, col, kind):
  22.         attr = wx.grid.GridCellAttr()
  23.         attr.SetEditor( wx.grid.GridCellChoiceEditor() )
  24.         return attr
  25.  
  26.  
  27. frame = wx.Frame(None)
  28. grid = wx.grid.Grid(frame)
  29. grid.SetTable( Source() )
  30. frame.Show()
  31.  
  32. app.MainLoop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement