2 from wxPython
.wx
import *
3 from wxPython
.lib
.grids
import wxFlexGridSizer
6 from threading
import Thread
11 Thread(target
=foo
).start()
13 class 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)
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
)
23 panel
.SetAutoLayout(true
)
24 #EVT_SIZE(panel, lambda e, p=panel: p.Layout())
25 EVT_BUTTON(self
, 11211, self
.Click
)
27 def Click(self
, event
):
33 win
= MyFrame(None, -1, "Bummer", wxDefaultPosition
, (200, 100))
35 self
.SetTopWindow(win
)