I gave a partial answer to a question, Can Manipulate controls be generated programmatically based on a (non-manipulated) variable?, which has led me to questions of my own.
Background:
The following code produces a pair of identical Sliders, where setting a value of 1 shows up in the other.
{Slider[Dynamic[d], {0, 1, 0.01}],
Dynamic[d],
Dynamic[Plot[Sin[1 + d x], {x, -10 \[Pi], 10 \[Pi]}]]
} & /@ Range[2]
e.g.,
Wrapping the code in a DynamicModule gives you something different, the ability to set the Sliders independently (a possibly useful thing to do):
dm = DynamicModule[{d},
{Slider[Dynamic[d], {0, 1, 0.01}],
Dynamic[d],
Dynamic[Plot[Sin[1 + d x], {x, -10 \[Pi], 10 \[Pi]}]]
}] & /@ Range[2]
{"Length", Length[dm]}
{"Dimensions", Dimensions[dm]}
TreeForm[dm]
I've added the Length, Dimensions, and TreeForm to better understand what the code actually produces.
Let's explore this a bit more:
dm[[1]]
Length[%]
Note, I set the Slider to 0.69 after executing the code.
And now I try to extract the Parts of the expression:
dm[[1, 1]]
dm[[1, 2]]
dm[[1, 3]]
This seems a bit strange.
I would have expected that I would get the 3 Parts of dm[[1]] in order, e.g:
Slider
Value
Plot
So, some questions:
Can someone explain this? The
Parts ofdm[[1]]don't appear to behave as one would expect.Does a way exist to access the current state of the 2
Plots indm, and for instanceShowthem together?Does the
TreeFormgive us any insight into how to do accessParts of such expressions?
I realize that these questions might resemble something akin to arcane chess problems, with not much real world application, but I hope that answers could give some additional working insight into these structures.





DynamicModule:List[d], anotherList, and aDelayedRule. – Josh Bishop Oct 30 '20 at 18:42