4
$\begingroup$

The following generates a Manipulate[] with an animator that is controlled with a slider and buttons.

Manipulate[Graphics[], {a, 1, 4}, ControlType -> Animator, AppearanceElements -> None]

I do not want the buttons at all and I don't want to lose any space where the controls would have been. The look I want is given by

Manipulate[Graphics[], {a, 1, 4}, ControlType -> None, 
 AppearanceElements -> None]

Notice there are no sliders, buttons or appearance elements and no lose space. Just a blank frame.

My issue is that I want the control type to be animator and I can't seem to get the desired look. Is it possible to retain animator as the control type but without any buttons or slider at all while not displaying any wasted space?

$\endgroup$
4
$\begingroup$

Manipulate

Manipulate[Graphics[Text[Style[Round[a] , RandomInteger[{46, 120}], Hue[RandomReal[]]]], 
      ImageSize -> 300, PlotRange -> {{-10, 10}, {-10, 10}}], 
   {{a, 1, ""}, 1, 10, ControlType -> Animator, AnimationRate -> 5, 
      AnimationRunning -> True, AppearanceElements -> {}}, 
   AppearanceElements -> {}, Paneled -> False] //
 Panel[#, FrameMargins -> {{0, 0}, {-10, -40}}] & 

enter image description here

Clock

repeats = 20; 
Dynamic @ Panel @ Graphics[Text[Style[Round[Clock[{0, 1, .1}, 1, repeats]], 
  RandomInteger[{46, 120}], Hue[RandomReal[]]]], 
 ImageSize -> 300, PlotRange -> {{-10, 10}, {-10, 10}}]

enter image description here

$\endgroup$
  • $\begingroup$ Is this Panel wrapper OS independent? $\endgroup$ – Kuba Dec 30 '17 at 8:06
  • $\begingroup$ @Kuba, it works in version 9.0 windows 10 and in version 11.2 on wolfram cloud. $\endgroup$ – kglr Dec 30 '17 at 8:34
  • $\begingroup$ I was thinking about mac/win because it is often a pain to adjust those values between them. Will check that next week, unless I forget. $\endgroup$ – Kuba Dec 30 '17 at 9:11
3
$\begingroup$

It will be easier with explicit Animator and Overlay. You can use it within Manipulate too but here there is no reason to keep it so I will change it to DynamicModule.

DynamicModule[ 
  {a}
, Panel @ Overlay[
    { Animator[Dynamic[a], {1, 4}, AppearanceElements -> None]
    , Panel @ Graphics[Inset @ Dynamic @ a]
    }
  , All
  , 2
  ]
]
$\endgroup$
  • $\begingroup$ Thanks! I see. I was hoping there was a simple answer with Manipulate. If I click on the little "+" button in appearance elements and click "Hide Controls" it does what is needed. I'm surprised isn't a simple option for that in the controls. $\endgroup$ – Michael McCain Dec 28 '17 at 12:49

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.