Dolamite Jenkins
asked on
x, y = event.GetPosition()
I figure this is pretty good cod to start with... I want to place an 'X' on the mouse click then save the x,y coordinate of that 'X' ...
import wx
class MoveEvent(wx.Frame):
def __init__(self, parent, id, title):
wx.Frame.__init__(self, parent, id, title)
wx.StaticText(self, -1, 'x:', (10,0))
wx.StaticText(self, -1, 'y:', (10,20))
self.st1 = wx.StaticText(self, -1, '', (30, 0))
self.st2 = wx.StaticText(self, -1, '', (30, 20))
self.Bind(wx.EVT_MOVE, self.OnMove)
self.Centre()
def OnMove(self, event):
x, y = event.GetPosition()
self.st1.SetLabel(str(x))
self.st2.SetLabel(str(y))
class MyApp(wx.App):
def OnInit(self):
me = MoveEvent(None, -1, 'moveevent.py')
me.Show(True)
return True
app = MyApp(0)
app.MainLoop()
I don't know python but I also don't understand what question you are asking.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks