~brian-sidebotham/wxwidgets-cmake/wxpython-2.9.4

« back to all changes in this revision

Viewing changes to wxPython/samples/wxPIA_book/Chapter-06/example2.py

  • Committer: Brian Sidebotham
  • Date: 2013-08-03 14:30:08 UTC
  • Revision ID: brian.sidebotham@gmail.com-20130803143008-c7806tkych1tp6fc
Initial import into Bazaar

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import wx
 
2
from example1 import SketchWindow
 
3
 
 
4
 
 
5
class 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
 
 
17
if __name__ == '__main__':
 
18
    app = wx.PySimpleApp()
 
19
    frame = SketchFrame(None)
 
20
    frame.Show(True)
 
21
    app.MainLoop()