Message Boards Message Boards

GROUPS:

Controlling a manipulate with embedded buttons?

Posted 7 years ago
8298 Views
|
4 Replies
|
1 Total Likes
|
Can I describe my project and get some general advice please?

I have written a fairly complicated Manipulate that allows exploration of Minkowski space-time. I would also like to add a series of text sections that describe various aspects of special relativity and automatically adjust a number of variables in the Manipulate when the user presses a button (say). So for example when reading about the Galilean transformation the velocity is set low and the scale variable is expanded etc etc. Whilst it would be possible to instruct the user to set up the variables from this main Manipulate controls it would seem good to allow this to be done by clicking a button in the text.

Can one embed say buttons as Manipulate controls and use them to control variables in a main Manipulate?

Should I use a single notebook or use my own html sections on the web page?
4 Replies
Maybe you want to nest two Manipulate expressions here?
group1[x_] := Manipulate[x, {x, 0, 1}];
group2[x_, y_] := Manipulate[{x, y}, {x, 0, 1}, {y, 0, 1}];
group3[x_, y_, z_] := Manipulate[{x, y, z}, {x, 0, 1}, {y, 0, 1}, {z, 0, 1}];

Manipulate[group, {
{group, group1[x], "Select group"},
{group1[x] -> "group1", group2[x, y] -> "group2", group3[x, y, z] -> "group3"}
}]


Or with a TabView:
TabView[{"group1" -> group1[x], "group2" -> group2[x, y], "group3" -> group3[x, y, z]}]

I want to know how to extract the values that are within the frame of Manipulate [], in this case {0,0,0} and assign them to new variables, or intruducirlas inside another manipulate[] as a recursive function

Or you can refer to this example about how to add buttons into Manipulate. 
Thanks guys. Ideally though, I wish to insert the buttons inline with the html text.

e.g.

text1
Main Manipulate
some more html or notebook text ,
button to set some variable in Main
yet more text,
another button to set variables in Main

etc
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract