How to get mouse values in ION [message #27488] |
Wed, 24 October 2001 15:47 |
James Adams
Messages: 7 Registered: October 2001
|
Junior Member |
|
|
Hello,
I have been trying to get mouse values from the ION system variable
$Mouse. However everything is not working as advertised, or more likely
I have misunderstood how to use this to get my mouse location I keep
getting (0, 0) for the (X, Y) of my mouse, and I don't think this is
correct. Attached is a brief ION Script which demonstrates what I'm
trying to do. Thanks in advance for any assistance or suggestions.
-James Adams
------------ GetMouseLocation.ion ---------------
<ION_SCRIPT>
<ION_HEADER>
<title>ION Mouse Location ION</title>
<EVENTS>
<EVENT_DECL NAME="REDRAW" ACTION="ion://GetMouseLocation.ion" />
</EVENTS>
<VARIABLE>
<VARIABLE_DECL NAME="X" VALUE="$Mouse.X" TYPE="INT",
PERSIST="TRUE" />
<VARIABLE_DECL NAME="Y" VALUE="$Mouse.Y" TYPE="INT",
PERSIST="TRUE" />
</VARIABLE>
</ION_HEADER>
<CENTER>
<H2>Mouse Location</H2>
<ION_BODY>
<B>Mouse X: </B><ION_EVALUATE EXPR="$Mouse.X" DISPLAY="TRUE" />
<BR>
<B>Mouse Y: </B><ION_EVALUATE EXPR="$Mouse.Y" DISPLAY="TRUE" />
<ION_DATA_OUT>
<IDL>
print, 'Mouse X Value: ', $Mouse.X
print, 'Mouse Y Value: ', $Mouse.Y
print, 'Variable X: ', $X
print, 'Variable Y: ', $Y
</IDL>
</ION_DATA_OUT>
<ION_FORM>
<ION_BUTTON TYPE="BUTTON" EVENT="REDRAW" LABEL="Redraw" />
</ION_FORM>
</ION_BODY>
</CENTER>
</ION_SCRIPT>
|
|
|