# How do I globally set control widths?

I have controls in a Manipulate that I'm laying out in a Grid and I'd like globally set their widths (and other properties). For example, something like

Grid[{{Control@{{sx3, 1}, -10, 10}, ...}]


but

SetOptions[Slider,{ImageSize-> 150, Appearance->"UpArrow"}]


has no effect; and

ctl[c_]:=Control[Join[c,{ImageSize->150, Appearance->"UpArrow"}]]
Grid[{{ctl@{{sx3, 1}, -10, 10}, ...}]


gives errors.

The only approach that works is to set these options for each control with

Grid[{{Control@{{sx3, 1}, -10, 10, ImageSize-> 150, Appearance->"UpArrow"}, ...}]


How do I globally set control widths (inside of Grid), and other properties so that I can avoid having to set them for each of my controls individually?

• because it is not a Slider, try SetOptions[Manipulator, {ImageSize -> 220, Appearance -> "UpArrow"}] – Kuba Aug 5 '17 at 19:13
• related: 32848 – Kuba Aug 5 '17 at 19:14

As @Kuba point out, the default slider-like control for Manipulate is actually a Manipulator, so you can do it like this.

SetOptions[Manipulator, {ImageSize -> 150, Appearance -> "UpArrow"}];
Manipulate[
{a, b, c, d},
Grid[
Map[
Control,
{{{a, 0, 1}, {b, 0, 1}}, {{c, 0, 1}, {d, 0, 1}}},
{-2}]]]


• Yes, as @Kuba pointed out. – orome Aug 5 '17 at 20:10
• @raxacoricofallapatorius. I have given him credit. – m_goldberg Aug 5 '17 at 20:12

You can globally define

slide =
Slider[##, Appearance -> {Tiny, "UpArrow"}, Background -> GrayLevel[0.95]] &;


And then inside a Manipulate

Grid[{
{"Lines", Control[{{nl, 4, ""}, 1, 128, 1, slide}]},
{"Length", Control[{{sc, 0.5, ""}, 0.02, 2, 0.02, slide}]},
{"Range", Control[{{rf, 1, ""}, 0.5, 2, slide}]}
}, Alignment -> Left, Spacings -> {0.5, 1.2}]


Similarily with other controls.

Inside constructs like Grid, Column etc. you must use Control.

• That still requires placing what is effectively a setting in each Control (albeit as a package). – orome Aug 5 '17 at 19:15

You can make your ctl function work with something like this:

Attributes[ctl] = HoldFirst;
ctl[{para__}] := Control[{para, ImageSize -> 150, Appearance -> "UpArrow"}]

Grid[{{ctl@{{sx3, 1}, -10, 10}}}]