]> git.saurik.com Git - wxWidgets.git/blame - wxPython/samples/wxPIA_book/Chapter-05/gridGeneric.py
fixed deadlock when calling wxPostEvent() from worker thread
[wxWidgets.git] / wxPython / samples / wxPIA_book / Chapter-05 / gridGeneric.py
CommitLineData
be05b434
RD
1import wx
2import wx.grid
3import generictable
4
5
6data = (("Bob", "Dernier"), ("Ryne", "Sandberg"),
7 ("Gary", "Matthews"), ("Leon", "Durham"),
8 ("Keith", "Moreland"), ("Ron", "Cey"),
9 ("Jody", "Davis"), ("Larry", "Bowa"),
10 ("Rick", "Sutcliffe"))
11
12colLabels = ("Last", "First")
13rowLabels = ("CF", "2B", "LF", "1B", "RF", "3B", "C", "SS", "P")
14
15
16class SimpleGrid(wx.grid.Grid):
17 def __init__(self, parent):
18 wx.grid.Grid.__init__(self, parent, -1)
19 tableBase = generictable.GenericTable(data, rowLabels,
20 colLabels)
21 self.SetTable(tableBase)
22
23class TestFrame(wx.Frame):
24 def __init__(self, parent):
25 wx.Frame.__init__(self, parent, -1, "A Grid",
26 size=(275, 275))
27 grid = SimpleGrid(self)
28
29if __name__ == '__main__':
30 app = wx.PySimpleApp()
31 frame = TestFrame(None)
32 frame.Show(True)
33 app.MainLoop()
34