diff options
| author | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
| commit | 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch) | |
| tree | f1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/elisp/dialog-boxes.html | |
new repository
Diffstat (limited to 'devdocs/elisp/dialog-boxes.html')
| -rw-r--r-- | devdocs/elisp/dialog-boxes.html | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/devdocs/elisp/dialog-boxes.html b/devdocs/elisp/dialog-boxes.html new file mode 100644 index 00000000..842139be --- /dev/null +++ b/devdocs/elisp/dialog-boxes.html @@ -0,0 +1,12 @@ + <h3 class="section">Dialog Boxes</h3> <p>A dialog box is a variant of a pop-up menu—it looks a little different, it always appears in the center of a frame, and it has just one level and one or more buttons. The main use of dialog boxes is for asking questions that the user can answer with “yes”, “no”, and a few other alternatives. With a single button, they can also force the user to acknowledge important information. The functions <code>y-or-n-p</code> and <code>yes-or-no-p</code> use dialog boxes instead of the keyboard, when called from commands invoked by mouse clicks. </p> <dl> <dt id="x-popup-dialog">Function: <strong>x-popup-dialog</strong> <em>position contents &optional header</em> +</dt> <dd> +<p>This function displays a pop-up dialog box and returns an indication of what selection the user makes. The argument <var>contents</var> specifies the alternatives to offer; it has this format: </p> <div class="example"> <pre class="example">(<var>title</var> (<var>string</var> . <var>value</var>)…) +</pre> +</div> <p>which looks like the list that specifies a single pane for <code>x-popup-menu</code>. </p> <p>The return value is <var>value</var> from the chosen alternative. </p> <p>As for <code>x-popup-menu</code>, an element of the list may be just a string instead of a cons cell <code>(<var>string</var> . <var>value</var>)</code>. That makes a box that cannot be selected. </p> <p>If <code>nil</code> appears in the list, it separates the left-hand items from the right-hand items; items that precede the <code>nil</code> appear on the left, and items that follow the <code>nil</code> appear on the right. If you don’t include a <code>nil</code> in the list, then approximately half the items appear on each side. </p> <p>Dialog boxes always appear in the center of a frame; the argument <var>position</var> specifies which frame. The possible values are as in <code>x-popup-menu</code>, but the precise coordinates or the individual window don’t matter; only the frame matters. </p> <p>If <var>header</var> is non-<code>nil</code>, the frame title for the box is ‘<samp>Information</samp>’, otherwise it is ‘<samp>Question</samp>’. The former is used for <code>message-box</code> (see <a href="displaying-messages#message_002dbox">message-box</a>). (On text terminals, the box title is not displayed.) </p> <p>In some configurations, Emacs cannot display a real dialog box; so instead it displays the same items in a pop-up menu in the center of the frame. </p> <p>If the user gets rid of the dialog box without making a valid choice, for instance using the window manager, then this produces a quit and <code>x-popup-dialog</code> does not return. </p> +</dd> +</dl><div class="_attribution"> + <p class="_attribution-p"> + Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br> + <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Dialog-Boxes.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Dialog-Boxes.html</a> + </p> +</div> |
