represents a pair of OK and Cancel buttons that close a dialog.
ChoiceButtons[{actok,actcancel}]
represents OK and Cancel buttons that evaluate the corresponding acti when clicked.
ChoiceButtons[{lblok,lblcancel},{actok,actcancel}]
uses the lbli to label the buttons.
ChoiceButtons
represents a pair of OK and Cancel buttons that close a dialog.
ChoiceButtons[{actok,actcancel}]
represents OK and Cancel buttons that evaluate the corresponding acti when clicked.
ChoiceButtons[{lblok,lblcancel},{actok,actcancel}]
uses the lbli to label the buttons.
Details
- ChoiceButtons arranges OK and Cancel buttons in the conventional order for the current computer system.
- ChoiceButtons[{lbl1,lbl2},{act1,act2},{opts1,opts2}] gives separate options for each button.
- ChoiceButtons[lbls,acts,opts,gopts] allows Grid options to be given to specify the layout of the buttons.
Examples
open all close allBasic Examples (2)
Scope (4)
ChoiceButtons[{"10 Factorial", "Fail"}, {Print[10!], Print[$Failed]}]Specify options for each button:
ChoiceButtons[{"10 Factorial", "Fail"}, {Print[10!], Print[$Failed]}, {Background -> Red, Appearance -> "Frameless"}]Specify options to the grid around the buttons:
ChoiceButtons[{"10 Factorial", "Fail"}, {Print[10!], Print[$Failed]}, {}, {Dividers -> All, Spacings -> 10}]Use the buttons to return from a dialog window:
CreateDialog[ChoiceButtons[]];Applications (1)
Properties & Relations (1)
ChoiceDialog is a DialogInput with ChoiceButtons which return True and False:
ChoiceDialog["Make a choice..."]DialogInput[Column[{"Make a choice...", ChoiceButtons[{DialogReturn[True], DialogReturn[False]}]}]]See Also
Tech Notes
Related Guides
History
Text
Wolfram Research (2008), ChoiceButtons, Wolfram Language function, https://reference.wolfram.com/language/ref/ChoiceButtons.html.
CMS
Wolfram Language. 2008. "ChoiceButtons." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ChoiceButtons.html.
APA
Wolfram Language. (2008). ChoiceButtons. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ChoiceButtons.html
BibTeX
@misc{reference.wolfram_2026_choicebuttons, author="Wolfram Research", title="{ChoiceButtons}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/ChoiceButtons.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_choicebuttons, organization={Wolfram Research}, title={ChoiceButtons}, year={2008}, url={https://reference.wolfram.com/language/ref/ChoiceButtons.html}, note=[Accessed: 12-June-2026]}