]> git.saurik.com Git - wxWidgets.git/blame - wxPython/tests/thrtest.py
hopefully fixes focus assertion
[wxWidgets.git] / wxPython / tests / thrtest.py
CommitLineData
9d8bd15f
RD
1
2from wxPython.wx import *
3from wxPython.lib.grids import wxFlexGridSizer
4
5import time
6from threading import Thread
7def foo():
8 for x in range(20):
9 print x, "Fooing!"
10 time.sleep(0.5)
11Thread(target=foo).start()
12
13class MyFrame(wxFrame):
14 def __init__(self, parent, ID, title, pos, size):
15 wxFrame.__init__(self, parent, ID, title, pos, size)
16 panel = wxPanel(self, -1)
17 self.panel=panel
18 box = wxFlexGridSizer(1, 2, 10, 10)
19 box.Add(wxButton(panel, 11211, "Foo"), 0, wxCENTER)
20 box.Add(wxButton(panel, 11211, "Bar"), 0, wxCENTER)
21 box.AddGrowableCol(1)
22 panel.SetSizer(box)
23 panel.SetAutoLayout(true)
24 #EVT_SIZE(panel, lambda e, p=panel: p.Layout())
25 EVT_BUTTON(self, 11211, self.Click)
26
27 def Click(self, event):
28 print "Click"
29
30
31class MyApp(wxApp):
32 def OnInit(self):
33 win = MyFrame(None, -1, "Bummer", wxDefaultPosition, (200, 100))
34 win.Show(true)
35 self.SetTopWindow(win)
36 return true
37
38MyApp(0).MainLoop()
39