[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: convert_coord problem



I suspect that your problem lies with the fact that you have several
graphics windows.  The convert_coord function uses the current output
device parameters to do the conversion to/from device or data
coordinates.  The straightforward solution is to store the following
system variables !P, !X, !Y, !Z after you have generated your graphics
plot from which you are getting the mouse position.  Then, copy the
stored variables back to the system variables whenever you need to
convert the mouse pointer again.

This may not be especially clear explanation - perhaps one of the more
eloquent readers of the group can clarify, if needed.

Klaus Scipal wrote:
> 
> Hi
> 
> I have a widget with several graphic windows. On of it returns the
> co-ordinates of the mouse button if pressed. These co-ordinates are then
> converted from device to data (longitude, latitude) using the convert_coord
> routine, and some data is plotted in the other windows. Now comes my
> problem: the convert_coord routine gives the correct co-ordinates only in
> its first call. when I try to convert another pair of co-ordinates the
> result is flawed. What can be wrong???
> 
> Klaus
> 
> p.s.: I use IDL 5.2 under Windows NT

-- 
-Bernard Puc
AETC,INC.   (http://www.aetc.com)
1225 Jefferson Davis Hwy, Suite 800
Arlington, VA 22202
(703) 413-0500