5
$\begingroup$

I'm currently working on a display project using Manipulate and was wondering if there is a straightforward way to alter the placement of the control options that I use. For example, the following shows my issue: control area

The Manipulate argument of concern is as follows:

Style["View Control", 16, Bold],
{{setter, True, ""}, {True -> "Zoom", False -> "Pan"}},
ControlPlacement -> Left,

I would just like the Zoom and Pan buttons of the SetterBar to be a bit larger and closer to centered if possible. I've messed with things like Appearance and Alignment, but haven't really had any luck with previous questions or my own efforts.

$\endgroup$

1 Answer 1

6
$\begingroup$

I think you've got to take over placement manually. First declare the variable setter with no control (None). Next add a SetterBar. Put this inside a Pane so you can control placement. The ImageSize of the Pane needs to be determined by hand. You can use ImageSize -> Full, which makes it fill the width of the notebook window -- perhaps desirable or not. You can Style the text how you wish.

Manipulate[setter,
 Delimiter, Style["View Control", 16, Bold],
 {{setter, True, ""}, None},
 Dynamic@Pane[
   SetterBar[Dynamic@setter,
     {True -> Style["Zoom", Larger], False ->  Style["Pan", Larger]}], 
   Alignment -> Center, ImageSize -> 100],
 ControlPlacement -> Left]

Mathematica graphics

If you are really fighting the automatic decisions of Manipulate, you might consider doing everything yourself in a DynamicModule. Many find it easier. (Or just go with the default in Manipulate.)

$\endgroup$
2
  • $\begingroup$ I used to control the SetterBar elements with f = Framed[#, Alignment -> Center, FrameStyle -> None, ImageSize -> {45, 25}] &;. And then simply: True -> f@"Zoom",.... A little way around, but SetterBar has no ItemSize option. $\endgroup$
    – Kuba
    Commented Jul 22, 2013 at 17:29
  • $\begingroup$ @Kuba One of the Wolfram people once showed me how to use Pane, the way you used Frame (mapping it onto each item). $\endgroup$
    – Michael E2
    Commented Jul 22, 2013 at 17:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.