I would like to have the Pink & Green CheckBox Control to be displayed on a single line. Despite extensive look on the ControlPlacement Help, I cannot adapt it to make it work.
Manipulate[
Graphics[{If[thePink, {Pink, Disk[{5, 5}, r]}],
If[theGreen, {Green, Disk[{4, 2}, r]}]},
PlotRange -> {{0, 20}, {0, 10}}], {{r, 1,
Style["Radius", Black, Bold, 12]}, 1, 5, 1, ControlType -> Setter,
ControlPlacement -> Top}, {{thePink, True,
Style["Pink", Black, Bold, 12]}, {True, False}}, {{theGreen, False,
Style["Green", Black, Bold, 12]}, {True, False}}]
Just like Table, Manipulate allows you to give more than one variable range specification. You can have as many variables as you like, including so many that a similar Table command would try to enumerate an unreasonably large number of entries.
Module allows you to set up local variables with names that are local to the module. Module creates new symbols to represent each of its local variables every time it is called. Module creates a symbol with name xxx$nnn to represent a local variable with name xxx.
Use Row[ ]
and Control[ ]
:
Manipulate[Graphics[{If[thePink, {Pink, Disk[{5, 5}, r]}],
If[theGreen, {Green, Disk[{4, 2}, r]}]}, PlotRange -> {{0, 20}, {0, 10}}],
{{r, 1, Style["Radius", Black, Bold, 12]}, 1, 5, 1, ControlType -> Setter,
ControlPlacement -> Top},
Row[
{Control@{{thePink, True, Style["Pink", Black, Bold, 12]}, {True, False}},
Spacer[20],
Control@{{theGreen, False, Style["Green", Black, Bold, 12]}, {True,False}}}]]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With