I have some stuff I would like to manipulate, using two different kinds of control, one at a time, using another variable as a switch. These controls are similar in principle to
Evaluate@(Sequence @@ {{controlA1, 0, 0.8}, {controlA2, 0, 2}})
and
{controlB, {-1, -1}, {1, 1}}
Therefore I tried using the code
Manipulate[
If[ChooseControlMode,
stuffA,
stuffB],
{{ChooseControlMode, False, "Choose control mode: "}, {True -> "A",
False -> "B"}, PopupMenu},
Dynamic@If[ChooseControlMode,
Evaluate@(Sequence @@ {{controlA1, 0, 0.8}, {controlA2, 0, 2}}),
{controlB, {-1, -1}, {1, 1}}]
]
However, for some reason MMA behaves as if what I meant to be my controls were actually simple text (and also splices the Sequence
inside If
, therefore preventing even this simple text from being displayed at the right time).
I also tried using something like
ReleaseHold@Dynamic@If[ChooseControlMode,
Hold@(Evaluate@(Sequence @@ {{controlA1, 0, 0.8}, {controlA2, 0,
2}})),
Hold@{controlB, {-1, -1}, {1, 1}}]
In this case instead I run into error
Manipulate::vsform: Manipulate argument
ReleaseHold[...]
does not have the correct form for a variable specification.
How can I get MMA to treat my input as additional controls and thus display them with their standard input (i.e., two Manipulator
s and a Slider2D
)?