Skip to main content
Plot needed Dynamic@ prepended to adjust properly.
Source Link
Nicholas G
  • 2.1k
  • 12
  • 17

Pursuant to jjc385's comment, the ideal answer is

DynamicModule[{tab = 2}, TabView[{ "Variables" -> TabView[{"A" -> TableForm@{{"a=", SetterBar[Dynamic[a], Range@3]}, {"b=", SetterBar[Dynamic[b], {0 -> "zero", 1, 2}]}, {"c=", SetterBar[Dynamic[c], {0, .5, 1}]}} , "B" -> "Nothing here."}] , "Graph" -> Plot[Sin[aDynamic@Plot[Sin[a x + b] + c, {x, 0, 2 Pi}] }, Dynamic[tab]] ]

which is a little different than the prior code which produced

enter image description here.

Now, the user can change several variables and the display only switches to the graph when the user tabs to it. Thanks!

Pursuant to jjc385's comment, the ideal answer is

DynamicModule[{tab = 2}, TabView[{ "Variables" -> TabView[{"A" -> TableForm@{{"a=", SetterBar[Dynamic[a], Range@3]}, {"b=", SetterBar[Dynamic[b], {0 -> "zero", 1, 2}]}, {"c=", SetterBar[Dynamic[c], {0, .5, 1}]}} , "B" -> "Nothing here."}] , "Graph" -> Plot[Sin[a x + b] + c, {x, 0, 2 Pi}] }, Dynamic[tab]] ]

which is a little different than the prior code which produced

enter image description here.

Now, the user can change several variables and the display only switches to the graph when the user tabs to it. Thanks!

Pursuant to jjc385's comment, the ideal answer is

DynamicModule[{tab = 2}, TabView[{ "Variables" -> TabView[{"A" -> TableForm@{{"a=", SetterBar[Dynamic[a], Range@3]}, {"b=", SetterBar[Dynamic[b], {0 -> "zero", 1, 2}]}, {"c=", SetterBar[Dynamic[c], {0, .5, 1}]}} , "B" -> "Nothing here."}] , "Graph" -> Dynamic@Plot[Sin[a x + b] + c, {x, 0, 2 Pi}] }, Dynamic[tab]] ]

which is a little different than the prior code which produced

enter image description here.

Now, the user can change several variables and the display only switches to the graph when the user tabs to it. Thanks!

Adjusting code with DynamicModule per jjc385's suggestion
Source Link
Nicholas G
  • 2.1k
  • 12
  • 17

I am working alongPursuant to jjc385's comment, the idea ofideal answer is

Dynamic[ TabView[DynamicModule[{"Graph" -> Plot[Sin[a x + b]tab += c2}, TabView[{x, 0, 2 Pi}]"Variables" ,-> "Variables"TabView[{"A" -> TableForm@{ {"a=", SetterBar[Dynamic[a], Range@3]}, {"b=", SetterBar[Dynamic[b], {0 -> "zero", 1, 2}]}, {"c=", SetterBar[Dynamic[c], {0, .5, 1}]}} , "B" -> "Nothing here."}] , "Graph" -> Plot[Sin[a x + b] + c, {x, 0, 2 Pi}] }, Dynamic[tab]] ]

which producesis a little different than the prior code which produced

enter image description here.

It has the problem that upon changing a variable, the front tab gets displayedNow, whereas I want the user to be able tocan change several valuesvariables and only then opt to see the result. A solution isdisplay only switches to change the order ofgraph when the user tabs to it. Thanks!

I am working along the idea of

Dynamic[ TabView[{"Graph" -> Plot[Sin[a x + b] + c, {x, 0, 2 Pi}] , "Variables" -> TableForm@{ {"a=", SetterBar[Dynamic[a], Range@3]}, {"b=", SetterBar[Dynamic[b], {0 -> "zero", 1, 2}]}, {"c=", SetterBar[Dynamic[c], {0, .5, 1}]}}}] ]

which produces

enter image description here.

It has the problem that upon changing a variable, the front tab gets displayed, whereas I want the user to be able to change several values and only then opt to see the result. A solution is to change the order of the tabs.

Pursuant to jjc385's comment, the ideal answer is

DynamicModule[{tab = 2}, TabView[{ "Variables" -> TabView[{"A" -> TableForm@{{"a=", SetterBar[Dynamic[a], Range@3]}, {"b=", SetterBar[Dynamic[b], {0 -> "zero", 1, 2}]}, {"c=", SetterBar[Dynamic[c], {0, .5, 1}]}} , "B" -> "Nothing here."}] , "Graph" -> Plot[Sin[a x + b] + c, {x, 0, 2 Pi}] }, Dynamic[tab]] ]

which is a little different than the prior code which produced

enter image description here.

Now, the user can change several variables and the display only switches to the graph when the user tabs to it. Thanks!

Source Link
Nicholas G
  • 2.1k
  • 12
  • 17

I am working along the idea of

Dynamic[ TabView[{"Graph" -> Plot[Sin[a x + b] + c, {x, 0, 2 Pi}] , "Variables" -> TableForm@{ {"a=", SetterBar[Dynamic[a], Range@3]}, {"b=", SetterBar[Dynamic[b], {0 -> "zero", 1, 2}]}, {"c=", SetterBar[Dynamic[c], {0, .5, 1}]}}}] ]

which produces

enter image description here.

It has the problem that upon changing a variable, the front tab gets displayed, whereas I want the user to be able to change several values and only then opt to see the result. A solution is to change the order of the tabs.