comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Cursor Position with Draw Widget
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Cursor Position with Draw Widget [message #3091 is a reply to message #3090] Thu, 03 November 1994 09:47 Go to previous messageGo to previous message
8015 is currently offline  8015
Messages: 52
Registered: November 1993
Member
In article <398t20$6im@agate.berkeley.edu>, Ken Ganga <ganga@physics14> wrote:
> Hi,
>
> I'm trying to figure out how to return the cursor position from an
> event in a draw widget. I want the coordinates to be in data
> coordinates. This seems to be possible for a regular graphics window
> through the cursor command, but I can't figure out how to do it within
> a draw widget as the documentation says not to use the cursor command.
>

The event returned from clicking in a draw widget contains an X and Y
parameter. You should be able to access it through event.x and
event.y. Here's a line from one of my applications that handles the
data conversion, also:

ll = convert_coord(event.x, event.y, /device, /to_data)

In this case it is converting the device coordinates to data
coordinates from a map projection. A few lines later, the following
commands put lat and lon coordinates in strings:

latstr = 'Lat: ' + string(ll(1), format='(F12.2)')
lonstr = 'Lon: ' + string(ll(0), format='(F12.2)')

Hope that helps,

Mike Schienle Hughes Santa Barbara Research Center
8015@sbsun0010.sbrc.hac.com 75 Coromar Drive, M/S B28/87
Voice: (805)562-7466 Fax: (805)562-7881 Goleta, CA 93117
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Problem with Exclusive Button Widgets under IDL for Windows (V3.6.1)
Next Topic: .AVI reader in IDL

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 16:34:41 PDT 2025

Total time taken to generate the page: 0.56175 seconds