]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/samples/wxPIA_book/Chapter-01/sample.py
4 class MyFrame(wx
.Frame
):
7 wx
.Frame
.__init
__(self
, None, -1, "My Frame", size
=(300, 300))
8 panel
= wx
.Panel(self
, -1)
9 panel
.Bind(wx
.EVT_MOTION
, self
.OnMove
)
10 wx
.StaticText(panel
, -1, "Pos:", pos
=(10, 12))
11 self
.posCtrl
= wx
.TextCtrl(panel
, -1, "", pos
=(40, 10))
13 def OnMove(self
, event
):
14 pos
= event
.GetPosition()
15 self
.posCtrl
.SetValue("%s, %s" % (pos
.x
, pos
.y
))
17 if __name__
== '__main__':
18 app
= wx
.PySimpleApp()