]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/samples/wxPIA_book/Chapter-14/grid_table_basic.py
4 class TestTable(wx
.grid
.PyGridTableBase
):
6 wx
.grid
.PyGridTableBase
.__init
__(self
)
7 self
.rowLabels
= ["uno", "dos", "tres", "quatro", "cinco"]
8 self
.colLabels
= ["homer", "marge", "bart", "lisa", "maggie"]
10 def GetNumberRows(self
):
13 def GetNumberCols(self
):
16 def IsEmptyCell(self
, row
, col
):
19 def GetValue(self
, row
, col
):
20 return "(%s,%s)" % (self
.rowLabels
[row
], self
.colLabels
[col
])
22 def SetValue(self
, row
, col
, value
):
25 def GetColLabelValue(self
, col
):
26 return self
.colLabels
[col
]
28 def GetRowLabelValue(self
, row
):
29 return self
.rowLabels
[row
]
31 class TestFrame(wx
.Frame
):
33 wx
.Frame
.__init
__(self
, None, title
="Grid Table",
35 grid
= wx
.grid
.Grid(self
)
37 grid
.SetTable(table
, True)
39 app
= wx
.PySimpleApp()