Response to user interaction inside Manipulate

2

I'd like to create a Manipulate with custom objects in the control area (like a circuit diagram) that reacts to the user interacting with the manipulate controls (e.g. highlighting the component being manipulated by the user).

Are there other functions/symbols besides $ControlActiveSetting (which does not discern which symbol is being manipulated) and ControlActive (which only evaluates to one of two things depending on wether the act in ControlActive[act, norm] is currently manipulated or not)? Ideally I'd like to have something like $ControlActiveSetting for individual symbols so that I can query those and change my display accordingly.

Sascha

Posted 2016-06-15T20:17:06.143

Reputation: 8 039

Question was closed 2016-06-16T16:42:42.613

The second argument of Dynamic or TrackingFunction can be used to achieve such behavior. – Karsten 7. – 2016-06-15T20:39:33.427

@Kuba I tied EventHandler already but it seems to interfere with the behavior of Slider. Try DynamicModule[{col = White, z}, EventHandler[ Slider[Dynamic@z, {0, 1}, Background -> Dynamic@col], {"MouseDragged" :> (col = Red), "MouseUp" :> (col = White)}]]. If you remove the "MouseUp"-event the slider behaves as it should. – Sascha – 2016-06-15T20:44:05.247

Add PassEventsDown -> True and it's fine. You can also use the second argument of Dynamic. – Kuba – 2016-06-15T20:50:34.607

Cloud you prepare a code samples with desired effects you struggle to achieve? – Kuba – 2016-06-15T20:51:59.750

I had a look at the second argument of Dynamic and the variant Dynamic[expr, {f, fEnd}] works like a charm once I looked it up. Even though this all is listed in the documentation and there are useful examples, I think it is easy to miss. – Sascha – 2016-06-15T20:56:22.027

@Sascha Sure, documentation is huge. Do you want to provide an example, or maybe we can find a duplicate about synchornizing dynamic elements. Like here: 30354

– Kuba – 2016-06-15T21:01:53.210

@Kuba Once I finish my work I'd gladly post it as an answer. I think it might be instructive to other users and seems not to be covered yet by other questions/answers about the second argument to Dynamic – Sascha – 2016-06-15T21:05:05.853

Hard to say without examples but it's not new: http://mathematica.stackexchange.com/search?q=second+argument+of+dynamic

– Kuba – 2016-06-15T21:06:25.010

No answers