]> git.saurik.com Git - wxWidgets.git/blame - wxPython/samples/wxPIA_book/Chapter-06/example3.py
RemoveItem should return the same object it is passed, but adjusted
[wxWidgets.git] / wxPython / samples / wxPIA_book / Chapter-06 / example3.py
CommitLineData
be05b434
RD
1import wx
2from example1 import SketchWindow
3
4class SketchFrame(wx.Frame):
5 def __init__(self, parent):
6 wx.Frame.__init__(self, parent, -1, "Sketch Frame",
7 size=(800,600))
8 self.sketch = SketchWindow(self, -1)
9 self.sketch.Bind(wx.EVT_MOTION, self.OnSketchMotion)
10 self.statusbar = self.CreateStatusBar()
11 self.statusbar.SetFieldsCount(3)
12 self.statusbar.SetStatusWidths([-1, -2, -3])
13
14 def OnSketchMotion(self, event):
15 self.statusbar.SetStatusText("Pos: %s" %
16 str(event.GetPositionTuple()), 0)
17 self.statusbar.SetStatusText("Current Pts: %s" %
18 len(self.sketch.curLine), 1)
19 self.statusbar.SetStatusText("Line Count: %s" %
20 len(self.sketch.lines), 2)
21 event.Skip()
22
23if __name__ == '__main__':
24 app = wx.PySimpleApp()
25 frame = SketchFrame(None)
26 frame.Show(True)
27 app.MainLoop()