2
$\begingroup$

I am attempting to put a control object of Manipulate[] into an OpenerView[] which will allow me to hide and show controls. The code below doesn't do what I want... but it should give you an idea of what I want.

Manipulate[Plot[Sin[x] + a, {x, -3, 3}],

 OpenerView[{"Open to Control a", {a, 1, 4, ControlType -> Slider}}]]

This is suppose to open and close an openerview to hide and show the controller for a. But I can't get the slider to appear. Below is picture of the problem.

enter image description here

$\endgroup$

2 Answers 2

6
$\begingroup$

Something like this?

enter image description here

Manipulate[
 Plot[Sin[x] + a, {x, -3, 3}],
 OpenerView[{"open to control ", Control[{{a, 1, "a"}, 0, 10, 1}]}]
 ]
$\endgroup$
1
  • $\begingroup$ Yes! Spent a couple hours on this and figured it out right after I posted it. lol. It seems like a good question that others might want to know the answer to so I'll leave it posted. Thank you for your time. $\endgroup$
    – B flat
    Dec 12, 2015 at 5:29
0
$\begingroup$

I guess I spoke to soon. I figured it out. I'll leave this here for anyone that has the same question.

Manipulate[Plot[Sin[x] + a, {x, -3, 3}, PlotRange -> 2], 
 OpenerView[{"Open to Control a", 
   Control[{{a, 1, "a"}, 1, 8, Slider}]}]]
$\endgroup$

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.