One can find primitives' properties such as the radius, the center or the color of a Disk
using Cases
by using:
g = Graphics[{Red, Disk[{0, 0}, 1], Black, Disk[{10, 0}, 5], Blue, Disk[{30, 0}, 3]}]
Cases[g, Disk[_, y_] :> y, Infinity]
Cases[g, Disk[x_, _] :> x, Infinity]
Cases[g, _RGBColor | _Hue | _GrayLevel, Infinity]
yielding the right values.
How can the same functions be applied to an EventHandler
?
Consider for instance the following code:
DynamicModule[{list = {{0, 0}, {2, 0}}},
Graphics[
EventHandler[
{Red, Dynamic@Disk[#, 1] & /@ list},
{"MouseClicked" :> {(* the appropriate function *)}}]]]
The aim would be the extract the radius/center/color of the clicked primitive.
Dynamic
because the radius is meant to change when clicked in the "real" case. $\endgroup$