Ørjan Pettersen wrote:
> How can I convert from an event.GetPosition() to a FloatCanvas coordinate?
> When I click the left mouse button, I would like to print the
> coordinates in the
> FloatCanvas canvas, and not the position in the window.
It's built into the FloatCanvas events:
Canvas.Bind(FloatCanvas.EVT_LEFT_DOWN, self.OnLeft)
def OnLeft(self, event):
print "world coords are:", event.Coords
print "pixel coords are:", event.GetPosition()
There is a full set of FloatCanvas events.
By the way, if you do have a reason to convert from pixel to world
coords, there is:
FloatCanvas.PixelToWorld()
and
FloatCanvas.WorldToPixel()
I wish I'd documented all this more, but do make sure to poke around the
demos and the source -- it's all there somewhere.
-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://paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas