Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Dynamic Interactivity > Custom Interface Construction > Dialog Boxes > ChoiceDialog >

ChoiceDialog

ChoiceDialog[expr]
puts up a standard choice dialog that displays expr together with OK and Cancel buttons, and returns True if OK is clicked and False if Cancel is clicked.
ChoiceDialog
includes buttons with labels , and returns the corresponding for the button clicked.
  • ChoiceDialog places buttons automatically, outside the area used to display expr.
  • Any expressions, including both text and graphics, can be used for expr and the .
  • In the window generated by ChoiceDialog[expr], pressing Enter is taken to be equivalent to clicking the OK button, while pressing Esc or closing the window is taken to be equivalent to clicking the Cancel button.
  • In ChoiceDialog, pressing Enter returns , while pressing Esc or closing the window returns .
  • ChoiceDialog by default puts up a dialog in the middle of the main display screen. Explicit settings for WindowMargins override this.
  • If Mathematica is run without a notebook front end, ChoiceDialog gives choices in a textual form.
Create a choice dialog:
Create a multiple choice dialog:
Create a choice dialog:
In[1]:=
Click for copyable input
Out[1]=
 
Create a multiple choice dialog:
In[1]:=
Click for copyable input
Out[1]=
New in 6 | Last modified in 7
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF