Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 10 down vote accepted


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.

share|improve this answer
Do you know why that additional Dyanmic is required only in this case? – R. M. Mar 27 '12 at 15:41
No. I haven't a clue. – DavidC Mar 27 '12 at 15:46
Thank you so much David, this has been driving me nuts. – Simon Woods Mar 27 '12 at 16:00
@Simon Glad to be of help. I still find it strange that Manipulate[x, {{x, 2}, {1, 2, 3}}] works fine by itself, with x behaving like a dynamic variable within Manipulate when Manipulate is not embedded in DialogInput`. – DavidC Mar 27 '12 at 16:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.