It is MWE, only a Disk[]
that should print "Click"
when clicked.
Also "date... updating"
should be printed on the first evaluation and on each update of variable enabled
. (which is constant in this MWE)
In the Column
there is another Dynamic
object which shows current MousePosition
. And this element is responsible for printing (flooding) "date... updating"
even though enabled
is not changing.
DynamicModule[{enabled = True, pos},
Column[{
Dynamic[Print[DateString[] <> " updating"];
EventHandler[Graphics@Disk[], {"MouseClicked" :> Print["Click"]}],
TrackedSymbols :> {enabled}]
,
Dynamic[pos]
}]
, Initialization :> (pos := MousePosition["Graphics"])]
I think I don't understand this and IMO it is not expected or desired behaviour.
When one put another Print
next to Graphics
you will see that it is in face whole Graphics
updating.
So the question is:
If it's not a bug (I missed something) then how to recreate this MWE so it behaves correctly.
I think it may be (but not necessarily) related to Why does a heavy background slow LocatorPane from updating, even if only the locators are Dynamic?
p.s. Dynamic[Refresh[..., TrackedSymbols:>{enabled}]]
behaves the same way.
Edit so at the end it seems to be more related to Button evaluation inside DynamicModule
DynamicModuleValues
. $\endgroup$