It works perfectly ! Thank you Chris ! J
2014-02-11 18:48 GMT+01:00 Chris Barker <[email protected]>: > I really need to work on docs... > > 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 ? >> > > myobj should have two attributes: > > myobj.HitCoords ==== the 'world' coordinates where the mouse was > > myobj.HitCoordsPixel === the coords in pixels (relative to the Panel, Im > pretty sure) > > > -Chris > > > > -- > > Christopher Barker, Ph.D. > Oceanographer > > Emergency Response Division > NOAA/NOS/OR&R (206) 526-6959 voice > 7600 Sand Point Way NE (206) 526-6329 fax > Seattle, WA 98115 (206) 526-6317 main reception > > [email protected] > > _______________________________________________ > FloatCanvas mailing list > [email protected] > http://mailman.paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas > >
_______________________________________________ FloatCanvas mailing list [email protected] http://mailman.paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas
