DialogReturn

DialogReturn[expr]

closes a dialog window, returning the expression expr from the dialog.

DialogReturn[]

closes a dialog window, returning Null.

Details

Examples

open allclose all

Basic Examples  (2)

Put up a dialog window that returns 123 when the button is clicked:

DialogReturn[] returns Null:

Scope  (3)

Create a dialog input window that returns a user input:

Enter a string in the field and click Proceed to return the string:

This input puts up a dialog window and does not wait for a return value:

Typing in the dialog window dynamically changes name but has no immediate effect on res:

The kernel evaluates other inputs while the dialog window is open:

After the Proceed button is clicked, the effect of DialogReturn[res=name] can be seen:

Return different values, depending which button is clicked:

Properties & Relations  (3)

This uses DialogReturn[] to return from the dialog notebook:

DefaultButton[] can be used instead of an explicit DialogReturn[]:

CancelButton[] implicitly uses DialogReturn[$Canceled]:

Wolfram Research (2007), DialogReturn, Wolfram Language function, https://reference.wolfram.com/language/ref/DialogReturn.html.

Text

Wolfram Research (2007), DialogReturn, Wolfram Language function, https://reference.wolfram.com/language/ref/DialogReturn.html.

CMS

Wolfram Language. 2007. "DialogReturn." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/DialogReturn.html.

APA

Wolfram Language. (2007). DialogReturn. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DialogReturn.html

BibTeX

@misc{reference.wolfram_2024_dialogreturn, author="Wolfram Research", title="{DialogReturn}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/DialogReturn.html}", note=[Accessed: 21-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_dialogreturn, organization={Wolfram Research}, title={DialogReturn}, year={2007}, url={https://reference.wolfram.com/language/ref/DialogReturn.html}, note=[Accessed: 21-November-2024 ]}