500
500

Reputation: 6629

Control Placement using Manipulate in Mathematica

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}}]

enter image description here

Upvotes: 5

Views: 916

Answers (1)

Dr. belisarius
Dr. belisarius

Reputation: 61046

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}}}]]

enter image description here

Upvotes: 5

Related Questions