This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

ChoiceDialog

ChoiceDialog[expr]
puts up a standard choice dialog that displays expr together with OK and Cancel buttons, and returns True if OK is pressed, and False if Cancel is pressed.
ChoiceDialog[expr, {lbl1->val1, lbl2->val2, ...}]
includes buttons with labels lbli, and returns the corresponding vali for the button pressed.
  • 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 lbli.
  • In the window generated by ChoiceDialog[expr], pressing Enter is taken to be equivalent to pressing the OK button, while pressing Esc or closing the window is taken to be equivalent to pressing the Cancel button.
  • In ChoiceDialog[expr, {lbl1->val1, ...}], pressing Enter returns val1, while pressing Esc or closing the window returns val2.
  • ChoiceDialog by default puts up a dialog in the middle of the main display screen. Explicit settings for WindowMargins override this.
New in 6