# Question about Slider and adding buttons

I would like to add some buttons next to a slider for higher accuracy movements. For instance I have this slider, which has 1-step, pretty easy to use.

In[2]:= Slider[Dynamic[x], {-5, 5, 1}, Appearance -> "Labeled"]


but if I try something like

Slider[Dynamic[x], {-100, 100, 0.001}, Appearance -> "Labeled"]


it is quit difficult to set x's value the precise one I want. Hence it would be helpful to add some arrow buttons that will be click and step.

Does anyone know if there is such an ability?

Furthermore it is crucial to have Dynamic[x] so that x is set in real time.

Thanks

• pressing Alt while dragging makes it more precise, with Alt+Shift even more.
– Kuba
Jan 21 '16 at 11:14
• Additionally, if you know the value of x that you desire, you can Show Animation Controls by clicking the tiny box at the end of the slider and typing that value (followed by <Enter>) into the box. Jan 21 '16 at 11:51

You can specify exactly what you want using controls. Have a look at the Introduction to Control Objects tutorial.

Manipulate[x,
Row[{
Slider[Dynamic@x, {-100, 100, 0.001}],
Button["\[LessLess]", x = Max[x - 0.01, -100]],
Button["<", x = Max[x - 0.001, -100]],
Button[">", x = Min[x + 0.001, 100]],
Button["\[GreaterGreater]", x = Min[x + 0.01, 100]]
}]
]


Hope this helps.

• This is exactly what I wanted, thank you for your help, I appreciate it. Jan 22 '16 at 10:16

Code:

Manipulate[
x,
{{x, 0, "X:"}, -100, 100, 0.001}
]


Output:

Reference:

Manipulate

Tutorial:

Introduction to Manipulate

• thank you very much, works as I wanted to. Nevertheless, how will I set x to each value? Dynamic[x] does not work.. Manipulate[Dynamic[x], {{x, 0, "X:"}, -100, 100, 0.001}] Jan 21 '16 at 11:56
• @Vasilis glad it helped, if you're satisfied with the answer I would appreciate if you would tick it as accepted answer :P Jan 21 '16 at 11:57