Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

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.)

share|improve this answer
    
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. –  Kuba Jul 22 '13 at 17:29
    
@Kuba One of the Wolfram people once showed me how to use Pane, the way you used Frame (mapping it onto each item). –  Michael E2 Jul 22 '13 at 17:37
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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