From 197fdd4bf934ea86b0de30bd53c4902bc1bbe161 Mon Sep 17 00:00:00 2001 From: Robert Strandh Date: Sat, 15 Apr 2017 12:09:28 +0200 Subject: [PATCH] Define ACCEPT method for classes. --- Interaction/presentations.lisp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Interaction/presentations.lisp b/Interaction/presentations.lisp index 5dbe986..2d757a0 100644 --- a/Interaction/presentations.lisp +++ b/Interaction/presentations.lisp @@ -18,7 +18,7 @@ (declare (ignore acceptably for-context-type)) (format stream "Text ~a ~a" (name (author object)) - (substitute #\Space #\Newline (subseq (contents object) 0 30)))) + (substitute #\Space #\Newline (subseq (contents object) 0 20)))) (clim:define-presentation-method clim:present (object @@ -31,3 +31,22 @@ (name (composer object)) (name (performer object)))) +(clim:define-presentation-method clim:accept + ((type class) + stream + (view clim:textual-view) + &key) + (multiple-value-bind (object success string) + (clim:complete-input + stream + (lambda (so-far action) + (clim:complete-from-possibilities + so-far + (loop for class-name in '(object person music text-document) + collect `(,(string-downcase class-name) + ,(find-class class-name))) + '() + :action action)) + :partial-completers '(#\Space)) + (declare (ignore success string)) + object))