Hey guys, Thanks for working all this out!
Cool to have enough of a community that I don't need to respond (OK, in this case enough is two people, but I'll take it) Do you think it's worth adding tooltip functionality into FloatCanvas directly? not much to it, but it might be handy. What should the API look like? contributions accepted, of course ;-) -Chris On Thu, Jan 24, 2013 at 5:17 AM, Werner F. Bruhin <[email protected]> wrote: > 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 -- 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://paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas
