message-box in Dialogs
See also message-box/custom.
(message-box-> symbol intitlemessageparentstyle)'(ok cancel yes no)
title: string (up to 200 characters)
message: string
parent=#f:frame%ordialog%object or#f
style='(ok): list of symbols in'(ok ok-cancel yes-no caution stop)Displays a message to the user in a (modal) dialog, using
parentas the parent window if it is specified. The dialog's title istitle. Themessagestring can be arbitrarily long, and can contain explicit linefeeds or carriage returns for breaking lines.The style must include exactly one of the following:
'ok-- the dialog only has an ``OK'' button and always returns'ok.'ok-cancel-- the message dialog has ``Cancel'' and ``OK'' buttons. If the user clicks ``Cancel'', the result is'cancel, otherwise the result is'ok.'yes-no-- the message dialog has ``Yes'' and ``No'' buttons. If the user clicks ``Yes'', the result is'yes, otherwise the result is'no. Note: instead of a ``Yes''/``No'' dialog, best-practice GUI design is to usemessage-box/customand give the buttons meaningful labels, so that the user does not have to read the message text carefully to make a selection.
In addition,
stylecan contain'cautionto make the dialog use a caution icon instead of the application (or generic ``info'') icon. Alternately, it can contain'stopto make the dialog use a stop icon. Ifstylecontains both'cautionand'stop, then'cautionis ignored.The class that implements the dialog provides a
get-messagemethod that takes no arguments and returns the text of the message as a string. (The dialog is accessible through theget-top-level-windowsfunction.)