4
$\begingroup$

When the control of Manipulate got expanded there's a display text box but it does not fully show the control value as shown in figure. Is there any way that the size of this box can be adjusted to show the complete form of the control value?

text box in Manipulate not showing the complete value

Example to reproduce the problem:

Manipulate[x, {x, 0, 2 Pi, Pi/6}]

Mathematica graphics

$\endgroup$
  • 2
    $\begingroup$ Can you provide some minimal code for reproducing this problem? $\endgroup$ – Szabolcs Feb 22 at 9:03
  • 2
    $\begingroup$ Only a partial solution (thus not an answer): Manipulate[x, {x, 0, 2 Pi, Pi/6, Appearance -> Large}] $\endgroup$ – Szabolcs Feb 22 at 10:28
  • 1
    $\begingroup$ A partial answer literally only for this kind of case: Style[ Manipulate[ Style[x, FractionBoxOptions -> {"Beveled" -> False}], {x, 0, 2 Pi, Pi/6}], FractionBoxOptions -> {"Beveled" -> True} ] $\endgroup$ – b3m2a1 Feb 22 at 10:40
  • $\begingroup$ @Szabolcs your solution worked for me. Thank you! $\endgroup$ – John P Feb 22 at 15:23
  • $\begingroup$ @JohnP It does not work well for me. Some of the bottom is still cut off. $\endgroup$ – Szabolcs Feb 22 at 15:31
0
$\begingroup$

Do you really need the full set of animation controls? Or do you only open them to be able to see and change the current value of the slider setting?

In the first case, I recommend

Manipulate[
  x,
  {x, 0, 2 Pi, Pi/6,
    Appearance -> "Labeled",
    AppearanceElements ->
      {"StepLeftButton", "PlayPauseButton", "StepRightButton", 
       "FasterSlowerButtons", "DirectionButton", "InlineInputField"}}]

demo

This eliminates the offending input field, but it is not needed. The value that appears to right of the slider can be selected and edited. When you are done editing, click in the content pane to update it — do not hit return or enter.

In the second, I recommend the simpler

Manipulate[
  x,
  {x, 0, 2 Pi, Pi/6, Slider, Appearance -> "Labeled"}]

demo

$\endgroup$
0
$\begingroup$

Update: You can use DefaultOptions directly when specifying the control:

Manipulate[x, 
  {x, 0, 2 Pi, Pi/6,
    Appearance -> "Open", 
    AppearanceElements -> All,
    DefaultOptions -> 
       {InputField -> {ImageSize -> {Small, 50}, Alignment -> Center}}}]

enter image description here

Original answer:

You can set the ImageSize of the InputField using DefaultOptions option of Manipulator:

manipulator1 = Manipulator[##, Appearance -> "Open", 
  DefaultOptions -> {InputField -> {ImageSize -> {Small, Full}, 
    FrameMargins -> 1, Alignment -> {Left, Center}}}] &;

Manipulate[x, {x, 0, 2 Pi, Pi/6, manipulator1}]

enter image description here

enter image description here

If you want to fix the height, use InputField -> {ImageSize -> {Small, 30}:

manipulator2 = Manipulator[##, Appearance -> "Open", 
   DefaultOptions -> {InputField -> {ImageSize -> {Small, 30}, 
       FrameMargins -> 1, Alignment -> {Left, Center}}}] &; 

Manipulate[x, {x, 0, 2 Pi, Pi/6, manipulator2}]

enter image description here

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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