As shown in the following example, ControlActive
does not seem to respond to controls such as SetterBar
. Moving the slider resets the value of k, but changing the value of x via SetterBar
does not.
Is there some other way to trigger an expensive calculation inside of a Manipulate
when some discrete control variable is changed?
Manipulate[
Row[{x, Spacer[10], y, Spacer[10], ControlActive[k = 0, k++]}]
, {x, {5, 6, 7, 8}, ControlType -> SetterBar}
, {y, 0, 1}
, Initialization :> (k = 0)
]
ControlActive
a switch and not a trigger. Therefore your question asks two different things, that aren't necessarily related. $\endgroup$