]>
Commit | Line | Data |
---|---|---|
1 | import wx | |
2 | import wx.grid | |
3 | ||
4 | class TestFrame(wx.Frame): | |
5 | ||
6 | rowLabels = ["uno", "dos", "tres", "quatro", "cinco"] | |
7 | colLabels = ["homer", "marge", "bart", "lisa", "maggie"] | |
8 | ||
9 | def __init__(self): | |
10 | wx.Frame.__init__(self, None, title="Grid Headers", | |
11 | size=(500,200)) | |
12 | grid = wx.grid.Grid(self) | |
13 | grid.CreateGrid(5,5) | |
14 | for row in range(5): | |
15 | grid.SetRowLabelValue(row, self.rowLabels[row]) | |
16 | grid.SetColLabelValue(row, self.colLabels[row]) | |
17 | for col in range(5): | |
18 | grid.SetCellValue(row, col, | |
19 | "(%s,%s)" % (self.rowLabels[row], self.colLabels[col])) | |
20 | ||
21 | app = wx.PySimpleApp() | |
22 | frame = TestFrame() | |
23 | frame.Show() | |
24 | app.MainLoop() |