Hello Folks
I am trying to display the coordinates of a wx.StaticBitmap
continuously as the mouse moves over it. I wrote an EVT_MOTION call
back to display it. It doesn't work. From what I understand,
wx.StaticBitmap is derived ffrom wx.Window and wx.Window supports
EVT_MOTION? Any thoughts would be helpful.
My code skeleton
self.img = wx.StaticBitmap(bitmap=wx.NullBitmap, id=wxID_FRAME1IMG,
name=u'img', parent=self.panel2, pos=wx.Point(8, 8),
size=wx.Size(2000,2000), style=wx.STATIC_BORDER)
wx.EVT_MOTION(self.img,self.OnMouseMove)
in the __init__ of the frame class
def OnMouseMove(self,event):
pt = event.GetPosition()
x=pt.x
y=pt.y
print x,y
event.Skip()
but it doesn't print x,y ..
I wrote a OnLeftButton event for the image which works!
(I load a different image using a different callback. So self.img is
not always wx.NullBitmap)
thanks
Krish