This module provides a simple dialog widget. You get to pick the
dialog title, if any, as well as its body and buttons.
Note that this dialog is really for simple use cases where you want
to get the user's answer to a question, such as "Would you like to
save changes before quitting?" As is typical in such cases, we assume
that this dialog box is used modally, meaning that while it is open
it is has exclusive input focus until it is closed.
If you require something more sophisticated, you'll need to build it
yourself. You might also consider seeing the Brick.Forms module for
help with input management and see the implementation of this module
to see how to reproduce a dialog-style UI.
Dialogs present a window with a title (optional), a body, and
buttons (optional). Dialog buttons are labeled with strings and map
to values of type a, which you choose.
Dialogs handle the following events by default with
handleDialogEvent:
Tab or Right Arrow: select the next button
Shift-tab or Left Arrow: select the previous button
Render a dialog with the specified body widget. This renders the
dialog as a layer, which makes this suitable as a top-level layer in
your rendering function to be rendered on top of the rest of your
interface.
Obtain the resource name and value associated with the dialog's
currently-selected button, if any. The result of this function is
probably what you want when someone presses Enter in a dialog.