I seem to be getting some unintended results from a nested Manipulate
that I have not been able to resolve. I boiled down the problem I'm having to a simplified version.
I can not seem to get the evaluation order of Manipulate
correct.
Manipulate[
Manipulate[
Print[{Parity, n}];
{Parity, n},
{n, Select[Range[1, 10, 1], Parity]}
],
{Parity, {OddQ, EvenQ}}
]
The problem isn't what it shows in the window, it is with what the Print statement outputs. For instance, if it is in the state EvenQ,2 and I click on OddQ, the Print output will read:
{OddQ,2}
Despite the fact that it shows {OddQ,1} in the window.
Why is this, and how can I fix it? In this boiled-down example it doesn't matter, but in my real life one, an error is issued every time I switch the outer manipulate.
{Parity, n}
toa={Parity, b=n}
and evaluate aDynamic[{a,b}]
in a new cell and see what happens then if you press the parity buttons. The value of a and b do not correspond to the displayed value of n in the Manipulate box even though they are the results of an assignment using the same n. $\endgroup$ – Sjoerd C. de Vries Mar 21 '12 at 22:27TrackedSymbols :> {n}
to the inner manipulate, the incorrect print output disappears and the window displays correct at all times. This solution prevents the error I was getting in the un-boiled-down problem. $\endgroup$ – Chris Roth Mar 22 '12 at 16:11