Message Boards Message Boards

How to pass function 'MousePosition' x,y cordinates to an array ?

Posted 8 years ago

Hi, Is there some way to pass the (x,y) coordinates position data to an array in real time I am using " PlotLabel -> Dynamic[MousePosition[]]" ?

POSTED BY: Asad Kazmi

Hi Asad,

perhaps you can adapt this to make it useful?

DynamicModule[{list = {}}, EventHandler[Dynamic[Framed@Graphics[{Red, Line[list], Point[list]}, 
PlotRange -> 2]], {"MouseClicked" :> AppendTo[list, MousePosition["Graphics"]]}]];
Dynamic[list]

enter image description here

Cheers,

Marco

POSTED BY: Marco Thiel
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract