Dynamic appearance of a control under ContinuousAction -> False

Imagine we have a heavy time consuming computation inside a Manipulate (which I model here by Pause[.5]):

Manipulate[Pause[.5]; x, {x, 0, 1, Appearance -> "Labeled"}]


In the above interface dragging the slider is tardy and rough due to slow content evaluation. In this case it is advisable to set ContinuousAction → False so the dragging of the slider is smooth and evaluation happens only on the slider release.

Manipulate[Pause[.5]; x, {x, 0, 1, ContinuousAction -> False, Appearance -> "Labeled"}]


But the numerical labels do not change during this action and we only guessing at what numerical value the slider will land.

Question: how can I make the numerical labels of controls change during slider drag and keeping content static and updatable only on control release?

Hi, Vitaliy .

Here’s a way.

Manipulate[
Pause[.5]; x,
Item[Manipulator[
Dynamic[y, {(y = #) &, (y = #) &, (y = x = #) &}], {0, 1}, 
ContinuousAction -> False,
Appearance -> {"Labeled", "Open"}]]
]

Xiang Li

Communication between controls and contents is done entirely though variable values. So if you want a control’s display to update but some content to not change, then they’ll need to be attached to different variables. Here’s an example of a single control that changes two local Manipulate variables -- one continuously as the control changes, and another only when the mouse button is released:

Manipulate[
 Pause[.5]; x, {x, 0, 1, None}, {xtmp, 0, 1, 
 Manipulator[
  Dynamic[xtmp, {Automatic, Automatic, (xtmp = #; x = #) &}], #2, 
  Appearance -> "Labeled"] &}]

This is great, thank you!