Nouvelle Collection
2014-02-11 14:09:19 UTC
Hello,
I create an image on a Canvas with:
myimg = self.Canvas.AddScaledBitmap(img, (x,y), Height=img.GetHeight(),
Position = 'tl')
myimg.Bind(FloatCanvas.EVT_FC_RIGHT_DOWN, self.OnShowPopupMenu)
When OnShowPopupMenu is called, the "myobj" parameter don't give the
position where the click has been done :
def OnShowPopupMenu(self, myobj):
event = ? # how to get the event here ?
pos = event.GetPosition()
pos = self.panel.ScreenToClient(pos)
self.panel.PopupMenu(self.popupmenu, pos)
How would you find the place where the click has been done when
EVT_FC_RIGHT_DOWN occurs ?
Best regards, J
I create an image on a Canvas with:
myimg = self.Canvas.AddScaledBitmap(img, (x,y), Height=img.GetHeight(),
Position = 'tl')
myimg.Bind(FloatCanvas.EVT_FC_RIGHT_DOWN, self.OnShowPopupMenu)
When OnShowPopupMenu is called, the "myobj" parameter don't give the
position where the click has been done :
def OnShowPopupMenu(self, myobj):
event = ? # how to get the event here ?
pos = event.GetPosition()
pos = self.panel.ScreenToClient(pos)
self.panel.PopupMenu(self.popupmenu, pos)
How would you find the place where the click has been done when
EVT_FC_RIGHT_DOWN occurs ?
Best regards, J