Fix if/else scope in yow.c from Rudi
[sxemacs] / info / lispref / dialog.texi
1 @c -*-texinfo-*-
2 @c This is part of the SXEmacs Lisp Reference Manual.
3 @c Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
4 @c Copyright (C) 2005 Sebastian Freundt <hroptatyr@sxemacs.org>
5 @c See the file lispref.texi for copying conditions.
6 @setfilename ../../info/dialog.info
7
8 @node Dialog Boxes, Toolbar, Menus, Top
9 @chapter Dialog Boxes
10 @cindex dialog box
11
12 @menu
13 * Dialog Box Format::
14 * Dialog Box Functions::
15 @end menu
16
17 @node Dialog Box Format
18 @section Dialog Box Format
19
20 A dialog box description is a list.
21
22 @itemize @bullet
23 @item
24 The first element of the list is a string to display in the dialog box.
25 @item
26 The rest of the elements are descriptions of the dialog box's buttons.
27 Each one is a vector of three elements:
28 @itemize @minus
29 @item
30 The first element is the text of the button.
31 @item
32 The second element is the @dfn{callback}.
33 @item
34 The third element is @code{t} or @code{nil}, whether this button is
35 selectable.
36 @end itemize
37 @end itemize
38
39 If the callback of a button is a symbol, then it must name a command.
40 It will be invoked with @code{call-interactively}.  If it is a list,
41 then it is evaluated with @code{eval}.
42
43 One (and only one) of the buttons may be @code{nil}.  This marker means
44 that all following buttons should be flushright instead of flushleft.
45
46 The syntax, more precisely:
47
48 @example
49    form         :=  <something to pass to `eval'>
50    command      :=  <a symbol or string, to pass to `call-interactively'>
51    callback     :=  command | form
52    active-p     :=  <t, nil, or a form to evaluate to decide whether this
53                     button should be selectable>
54    name         :=  <string>
55    partition    :=  'nil'
56    button       :=  '['  name callback active-p ']'
57    dialog       :=  '(' name [ button ]+ [ partition [ button ]+ ] ')'
58 @end example
59
60
61 @node Dialog Box Functions
62 @section Dialog Box Functions
63
64 @defun popup-dialog-box dbox-desc
65 This function pops up a dialog box.  @var{dbox-desc} describes how the
66 dialog box will appear (@pxref{Dialog Box Format}).
67 @end defun
68
69 @xref{Yes-or-No Queries}, for functions to ask a yes/no question using
70 a dialog box.