Tag Info

Hot answers tagged

6

Body of Manipulate is wrapped by Dynamic and Dynamic doesn't know what's inside inner Dynamics, that's how we can screen a variable to not prompt the very outer Dynamic to evaluate: Manipulate[ e = RandomVariate[NormalDistribution[0, sigma], n]; {Dynamic@a, e}, {{n, 3}, 1, 5, 1, Appearance -> "Labeled"}, {{sigma, 1}, 1, 2, Appearance -> ...


3

DynamicEvaluationTimeout and Style may be used to locally set the dynamic timeout bound: DynamicModule[{a = "start"}, Style[{ Button["does time out", Pause[6]; a = "end"], Dynamic[a]}, DynamicEvaluationTimeout -> 10]]


2

One possibility is to use MapIndexed: n = 3; dyn = Table[False, {i, n}]; A = Dynamic@Transpose[{Range[n], dyn}] MapIndexed[Checkbox[Dynamic[dyn[[#2[[1]]]]]] &, Range[n]]


2

Compare the output of this: Table[ Dynamic[i], {i,3}] (* gives {i,i,i} *) with this: Table[ With[{i=i},Dynamic[i]], {i,3}] (* gives {1,2,3} *) Now you can use that: a = Range[3]; Table[ With[{i=i}, Dynamic[ a[[i]] ] ], {i,3}] (* gives {1,2,3} *) Then: a+=1; (* changes output above to {2,3,4} *) Addendum to address question in the comments ...


1

The Table approach: data = {{66, 55, 3}, {44, 33, 2}, {22, 11, 1}}; Grid[{{Style["direction North", Bold]}}~Join~ Table[{Style["traffic path", Bold], i, Labeled[InputField[Dynamic[data[[#, 1]]] &@i, FieldSize -> 10], "Q", Left, LabelStyle -> Directive[Bold]], Labeled[InputField[Dynamic[data[[#, 2]]] ...


1

Try this: data = {{66, 55, 3}, {44, 33, 2}, {22, 11, 1}}; MapIndexed[(d[First[#2]] = #[[1]]) &, data]; MapIndexed[(e[First[#2]] = #[[2]]) &, data]; MapIndexed[(f[First[#2]] = #[[3]]) &, data]; Grid[Prepend[Map[Function[i, {Style["traffic path", Bold], i, Labeled[InputField[Dynamic[d[i], (d[i] = data[[i, 1]] = #) &], ...



Only top voted, non community-wiki answers of a minimum length are eligible