Next: Modeless Dialogs
Up: Dialogs
Previous: Dialogs
Modal dialogs are designed to ask specific questions and wait until
they receive a response. All other interaction is disabled until the
dialog is dismissed -- they place the system in dialog mode. Six
functions are available for producing some standard modal dialogs:
-
(message-dialog < string>) -- presents a message with an
OK button; returns nil when the button is pressed.
-
(ok-or-cancel-dialog < string>) -- presents a message with
an OK and a Cancel button; returns t or
NIL according to the button pressed.
-
(choose-item-dialog < string> < string-list>) -- presents
a heading and a set of radio buttons for choosing one of the strings.
Returns the index of the selected string on OK or nil
on Cancel. Example:
> (choose-item-dialog "Dependent variable:" '("X" "Y" "Z"))
1
-
(choose-subset-dialog < string> < string-list>) -- presents
a heading and a set of check boxes for indicating which items to select.
Returns a list of the list of selected indices on OK or nil
on Cancel. Example:
> (choose-subset-dialog "Independent variables:" '("X" "Y" "Z"))
((0 2))
-
(get-string-dialog < prompt> [:initial < expr>]) --
presents a dialog with a prompt, an editable text field, an OK and
a Cancel button. The initial contents of the editable field is empty
or the princ formated version of < expr>. The result is a
string or nil. Example:
> (get-string-dialog "New variable label:" :initial "X")
"Tensile Strength"
-
(get-value-dialog < prompt> [:initial < expr>]) --
like get-string-dialog, except
-
the initial value expression is converted to a string with print
formatting
-
the result is interpreted as a lisp expression and is evaluated
-
the result is a list of the value, or nil
On the Macintosh there are two additional dialogs for dealing with files:
-
(open-file-dialog) -- presents a standard Open File dialog
and returns a file name string or nil. Resets the working folder on
OK.
-
(set-file-dialog prompt) -- presents a standard Save
File dialog. Returns a file name string or nil. Resets the working
folder on OK.
Next: Modeless Dialogs
Up: Dialogs
Previous: Dialogs
Luke Tierney
Tue Jan 21 15:04:48 CST 1997