]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/samples/wxPIA_book/Chapter-06/example3.py
2 from example1
import SketchWindow
4 class SketchFrame(wx
.Frame
):
5 def __init__(self
, parent
):
6 wx
.Frame
.__init
__(self
, parent
, -1, "Sketch Frame",
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])
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)
23 if __name__
== '__main__':
24 app
= wx
.PySimpleApp()
25 frame
= SketchFrame(None)