I wish to use Buttons to trigger alternate Manipulates.
According to the documentation: "The first argument to Button is the label" ....and the "second argument is the function that will evaluate when you click the button." (source: https://reference.wolfram.com/language/tutorial/IntroductionToControlObjects.html
Here is simple code which works and runs a Manipulate
Remove[a, b, ma, mb]
ma[a_, b_] := a^2 + b
Manipulate[ma[a, b], {{a, 1}, 0, 5}, {{b, 1}, 0, 5}]
And here is modified example which SHOULD work via button according to the documentation (unless Manipulate is not in fact a function!). This code does NOT work.
Remove[a, b, ma, mb]
ma[a_, b_] := a^2 + b
Button["Crazy Dead Button",Manipulate[ma[a, b], {{a, 1}, 0, 5}, {{b, 1}, 0, 5}]]
The documentation is leading me astray. Only some functions can be triggered this way I guess. But why not, and what is easiest way to fix the code?
Button["Crazy Dead Button", Print@Manipulate[ma[a, b], {{a, 1}, 0, 5}, {{b, 1}, 0, 5}], Method -> "Queued"]
? $\endgroup$Button["Crazy Dead Button", CellPrint[Manipulate[ma[a, b], {{a, 1}, 0, 5, Appearance -> "Labeled"}, {{b, 1}, 0, 5, Appearance -> "Labeled"}]]]
$\endgroup$