On 24/01/2013 13:08, Benjamin Jessup wrote:
> mouse_position = self.FC.ScreenToClient(wx.GetMousePosition())
> fcpos = self.FC.PixelToWorld( mouse_position )
> mouse_position = self.FC.WorldToPixel(fcpos)
No that does not help, this is what I get.

2013-01-24 14:13:15,967 - twcbsrc.controllers.fwinerackview - DEBUG - 
fwinerackview.py - 190 - fcobject mousepos: (185, 147)
2013-01-24 14:13:15,970 - twcbsrc.controllers.fwinerackview - DEBUG - 
fwinerackview.py - 191 - fcobject fcpos: [  9.7905478  50.       ]
2013-01-24 14:13:15,986 - twcbsrc.controllers.fwinerackview - DEBUG - 
fwinerackview.py - 192 - fcobject mousepos 2: [185 147]
2013-01-24 14:13:15,987 - twcbsrc.controllers.fwinerackview - DEBUG - 
fwinerackview.py - 195 - fcobject pos: (185, 147)
2013-01-24 14:13:15,990 - twcbsrc.controllers.fwinerackview - DEBUG - 
fwinerackview.py - 197 - screen pos: (2121, 533)

And this is the code in my EVT_FC_LEFT_DOWN handler for the object:

     def objectHit(self, fcobject):
         mouse_position = self.canvas.ScreenToClient(wx.GetMousePosition())
         fcpos = self.canvas.PixelToWorld( mouse_position )
         mouse_position2 = self.canvas.WorldToPixel(fcpos)
         log.debug('fcobject mousepos: %s' % str(mouse_position))
         log.debug('fcobject fcpos: %s' % str(fcpos))
         log.debug('fcobject mousepos 2: %s' % str(mouse_position2))

         posForSTT = fcobject.HitCoordsPixel
         log.debug('fcobject pos: %s' % str(posForSTT))
         posForSTT += self.canvas.GetScreenPosition()
         log.debug('screen pos: %s' % str(posForSTT))
         self.showToolTip(fcobject, posForSTT)

No big deal as adding the two numbers is not that difficult:-) .

Anyhow thanks for looking at it and for your tips.

Werner
_______________________________________________
FloatCanvas mailing list
[email protected]
http://paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas

Reply via email to