CLIM mail archive
[Prev][Next][Index][Thread]
Accepting-values
Date: Wed, 1 Apr 1992 12:08 EST
From: Erik Eilerts <eilerts@cs.utexas.edu>
Does anyone have some clim code they could send me that does the
following:
1. pops up a window
2. makes a call to accepting-values using that window as the stream
This is exactly what the :own-window option to accepting-values is there for.
Here's a toy example. Note the use of a simple restart so you can return nil
when the dialog is aborted.
(defun sandwich (&optional (stream *query-io*))
(with-simple-restart (abort "Forget the Sandwich")
(let* ((s-type :steak)
(steak-options (list :mustard :onions))
(italian-options (list :lettuce :tomatoes))
(options steak-options))
(accepting-values (stream :own-window t
:exit-boxes '((:exit " Cool") (:abort " Forget It"))
:label "Choose a Sandwich")
(setq s-type (accept '(member :steak :italian)
:stream stream
:prompt "Type"
:default s-type))
(terpri stream)
(setq options
(if (eql s-type :steak)
(setq steak-options
(accept '(subset :mustard :onions :cheese :peppers)
:stream stream
:prompt "With"
:default steak-options))
(setq italian-options
(accept '(subset :lettuce :tomatoes :pickles)
:stream stream
:prompt "With"
:default italian-options)))))
(return-from sandwich (cons s-type options))))
nil)
References:
Main Index |
Thread Index