[Jprogramming] mouse coordinates in plots

Eric Iverson eiverson at sympatico.ca
Sun Sep 3 23:39:03 HKT 2006


A useful tool in looking at events is showevents defined in script misc. 
Create a plot and try the following.

   load'misc'
   showevents 1 NB. show event

Moving the mouse around the plot will display plot_gs_mmove in the ijx 
window for every move.

   showevents 2 NB. show complete event data

Move the mouse on the plot then off. The complete event data for each 
event is displayed in the ijx window. Scroll the ijx window to see the 
line for sysevent and you will see plot_gs_mmove. Scroll to see the line 
for syslocale and you will see jwplot. This means the event handler for 
a mouse move is verb plot_gs_mmove in locale jwplot.

   plot_gs_mmove_jwplot_ NB. display the event handler

The handler does nothing so you can easily and safely override it for an 
experiment by defining a new handler in the jwplot locale.

   showevents 0 NB. turn off event display
   plot_gs_mmove_jwplot_ =: 3 : 'smoutput sysdata'

Now mouse moves on the plot display sysdata which is text that contains 
the mouse position and other information.

Caution: in the future plot might have its own mouse move handler and 
you'd have to be more carefull how you overrode it.

----- Original Message ----- 
From: "Carl F. Buhrer" <cfbuhrer at rcn.com>
To: <programming at jsoftware.com>
Sent: Sunday, September 03, 2006 10:49 AM
Subject: [Jprogramming] mouse coordinates in plots


>    Several months ago I requested help in reading the mouse 
> coordinates when it is moved over a plot generated by the  "plot"
> capability of the J system.   In a reply that I have subsequently lost 
> I was referred to a related reference which  works well with the 
> "viewmat" capability  and  displays the positional and color 
> coordinates of the cursor in the TITLE field.  I tried modifications 
> to adapt these to work with "plot"  but with no understanding of 
> system references  nothing that I tried would work.  Help in finding a 
> way to get  "plot"  mouse coordinates would be most 
> appreciated. ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm 



More information about the Programming mailing list