q pos nowait [Sec=Unclassified]

Neil Adams N.Adams at BOM.GOV.AU
Tue Aug 18 18:39:09 EDT 2009


Hi Austin,

    Thanks for that. The X windows system does continuously monitor
mouse events and so always knows where the mouse is. GrADS makes the
mouse location info available through q pos with a click of the mouse
but the system would also always know where the mouse was located (eg
IDL, McIDAS to name two graphics display systems that continuously
monitor the mouse and report location and field values under the mouse).
I was hoping the 'q pos nowait' was the GrADS answer to this. I've set
up a system using xev to continuously report back the mouse location in
the GrADS graphics window and am in the process of coding up the GrADS
mapping transformations to convert the mouse relative positions to
lat-lon values. An internal GrADS function to do this would be a far
neater solution though.

Cheers
Neil

Austin Conaty wrote:
> Maybe I misunderstand what you're trying to do...
> If the user never clicks on the map, how will grads
> know where the cursor is?
>
> How do you expect q pos to get the x y information?
>
> I don't believe grads is capable of continuously
> monitoring/keeping track of where the mouse is
> and so it's not capable of continuously telling you
> the coordinates as you move around the map.
>
> I have seen interactive "web based" tools that
> can give you a read on the mouse location,
> but don't think grads can do it internally.
> (not without the clicking)
>
> Just my 2 cents worth...
>
> Neil Adams wrote:
>> Hi every one,
>>
>>     I'm trying to write a script that will allow the display of the
>> coordinates underneath the mouse to be continuously displayed. The
>> following code snippet will do it but requires the user to click the
>> mouse to update the position information:
>>
>>                'set lat -90 -40'
>>                 'set lon 0 180'
>>                 'set cint 4'
>>                 'set ccolor 6'
>>                 'd mslp'
>>                  while (1)
>>                   'q pos'
>>                   x=subwrd(result,3)
>>                   y=subwrd(result,4)
>>                   'q xy2w 'x' 'y
>>                   lon=subwrd(result,3)
>>                   lat=subwrd(result,6)
>>                   'draw recf 6.0 0.0 10.0 0.5'
>>                   'draw string 6.1 0.1 'lat' 'lon
>>                 endwhile
>>
>> I want the the code to work without having to click. From reading the
>> manual I though that using 'q pos nowait' instead of 'q pos' would do
>> the trick but it ends up behaving exactly the same as 'q pos'. Any
>> clues as to how to get this functionality into a display ? I've
>> tested the script on v1.9b4 32-bit and on v2.0.a5
>>
>> Cheers
>> Neil
>>
>> --
>> _________________________________________________________________
>> Dr. Neil Adams (SPOB),
>> Regional Manager Antarctic Meteorological Section, Tasmania and
>> Antarctica Region,
>> Bureau of Meteorology, GPO Box 727 Hobart TAS 7001.
>> Ph +61 3 62212032       Fax +61 3 62212080      Mobile +61 417331181
>> Email: N.Adams at bom.gov.au<mailto:N.Adams at bom.gov.au>
>> _________________________________________________________________
>>
>>
>> --
>> This message has been scanned for viruses and
>> dangerous content by MailScanner and is believe to be clean.
>>
>>
>
>
>

--
_________________________________________________________________
Dr. Neil Adams (SPOB),
Regional Manager Antarctic Meteorological Section, Tasmania and Antarctica Region,
Bureau of Meteorology, GPO Box 727 Hobart TAS 7001.
Ph +61 3 62212032       Fax +61 3 62212080      Mobile +61 417331181
Email: N.Adams at bom.gov.au
_________________________________________________________________



More information about the gradsusr mailing list