Coordinates in EventHandler
- To: mathgroup at smc.vnet.net
- Subject: [mg116761] Coordinates in EventHandler
- From: Fred Simons <f.h.simons at tue.nl>
- Date: Sat, 26 Feb 2011 06:08:34 -0500 (EST)
The following command gives an event handler which assigns the mouse position to a variable res when the mouse is clicked : eh=EventHandler[Framed[Graphics[PlotRange->1, Axes->True, Background->Yellow]], "MouseClicked":> (res=MousePosition["Graphics"])] Dynamic[res] Now I place this event handler in another graphics: Framed[Graphics[Inset[eh, {1.5, 0.7}, {0, 0}], PlotRange -> 4, Axes -> True]] Clicking in the yellow event handler shows that the mouse position in the outer graph is assigned to res, instead of the mouse position in the event handler. Does someone know how, in this situation, can we assign the mouse position in the event handler to res? (Of course without using coordinate transformations) Many thanks in advance, -- Fred Simons Eindhoven University of Technology