]> git.saurik.com Git - wxWidgets.git/blame - wxPython/samples/wxPIA_book/Chapter-06/example2.py
fixed deadlock when calling wxPostEvent() from worker thread
[wxWidgets.git] / wxPython / samples / wxPIA_book / Chapter-06 / example2.py
CommitLineData
be05b434
RD
1import wx
2from example1 import SketchWindow
3
4
5class SketchFrame(wx.Frame):
6 def __init__(self, parent):
7 wx.Frame.__init__(self, parent, -1, "Sketch Frame",
8 size=(800,600))
9 self.sketch = SketchWindow(self, -1)
10 self.sketch.Bind(wx.EVT_MOTION, self.OnSketchMotion)
11 self.statusbar = self.CreateStatusBar()
12
13 def OnSketchMotion(self, event):
14 self.statusbar.SetStatusText(str(event.GetPositionTuple()))
15 event.Skip()
16
17if __name__ == '__main__':
18 app = wx.PySimpleApp()
19 frame = SketchFrame(None)
20 frame.Show(True)
21 app.MainLoop()