Prompts the user for input using a pop-up dialog box. The user may be prompted to select from multiple options, or enter text input.
<dialog title={Error} {You can't select that option now}> — Displays a message, with an OK button to close it.
<dialog {Exit now?} choices={OK} symbol={?}> — Displays a question prompt with a question mark symbol where the user can
either select "OK" or they can cancel the dialog prompt.
{Enter your name:}, or
{Are you sure you wish to continue?}.
{?}.What the tag generates depends on the kind of dialog:
text=true: the text the user entered. Any choices are offered as suggestions in an editable drop-down list, with the first one filled in.When the tag is complete, user interaction with the console is temporarily suspended and a dialog prompt is shown to the user. After the user responds to the dialog prompt, the dialog tag generates a value containing the user's response to the prompt. The tag's lifetime then ends.
How a dialog looks, and which of its fields are shown, is decided by the framing manager of the user's desktop environment. For example, the Periscope framing manager shows the dialog as a panel across the top of the program, with its title above the message, its symbol beside it, and the choices and Cancel on the keyboard's function keys and Esc key. Without a framing manager, a plain pop-up box is shown, which may leave out the title and symbol.
Although the dialog tag displays stuff on the screen, it behaves as a transient logic tag rather than a presentation tag. This is because it evaluates and generates a result once, rather than creating a persistent tag instance in the document tree.
The following example demonstrates how you can output a dialog tag from a Python program to get the user's response to a simple OK/Cancel question, and get the user's response input back to your program in the simple format of "Y" for yes or "N" for no.
user_response = input('<putLn|if <dialog {Are you sure you want to continue?} choices={OK}> then={Y} else={N}>')