Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to extract the Graphics type when I hover my mouse over an object, but I failed to do so. Below is the code I am working on. Any suggestions are welcome

m = "E";
  Mouseover[ {Black, Disk[{-10, 0}]}, {m = "D"; Red, Disk[{-10, 0}]}],
  Mouseover[ {Black, Rectangle[{10, 0}]}, {m = "R"; Red, 
    Rectangle[{10, 0}]}]
  ,  Text[Dynamic[m], {0, 0}]
share|improve this question
Have a look at Annotation, it appears that fits what you're trying to do. – ciao Feb 24 '14 at 9:25

Use Dynamic inside Mouseover

  Mouseover[{Black, Disk[{-10, 0}]}, Dynamic[{m = "D"; Red, Disk[{-10, 0}]}]],
  Mouseover[{Black, Rectangle[{10, 0}]}, Dynamic[{m = "R"; Red, Rectangle[{10, 0}]}]],
  Dynamic@Text[m, {0, 0}]
  }, ImageSize -> 400]

enter image description here

share|improve this answer
Thank you very much – Gurwho Feb 24 '14 at 10:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.