Some controls do not appear to work with Manipulate
inside a DialogInput
. For example:
DialogInput[{Manipulate[x, {x, {1, 2, 3}}], DefaultButton[]}]
does not work, but the slider version:
DialogInput[{Manipulate[x, {x, 1, 3, 1}], DefaultButton[]}]
does work.
Is this a bug or am I missing a vital option setting?
Answer
Try
DialogInput[{Manipulate[Dynamic[x], {{x, 2}, {1, 2, 3}},
LocalizeVariables -> False], Button["OK", DialogReturn[x]]}]
I'm not sure why Dynamic
is required.
LocalizeVariables -> False
allows the value of x
to be returned (outside of the scope of the Manipulate
. LocalizedVariables
was shown to be necessary for a Manipulate
embedded in DialogInput
. See here.
Comments
Post a Comment