CLIM mail archive


stopping echoing of accepting?

   Date: Fri, 6 Dec 91 17:25:28 CST
   From: David Neves <>

   We wrote our own simple version of accept to get around this problem using
   read-gesture and find-innermost-applicable-presentation. 
   find-innermost-applicable-presentation wants an input context whose
   structure or creation isn't documentated very well in the manual.  The only
   way we could think of creating it was to wrap
   find-innermost-applicable-presentation within with-input-context and using
   the variable *input-context* for the input context.  Is there a better way?

   (defun get-user-input (stream)
     (let ((gesture (read-gesture :stream stream))
       (typecase gesture
	  (setf presentation
		(with-input-context (t) nil
		      (find-innermost-applicable-presentation *input-context*
	  (if presentation
	    (values (presentation-object presentation) 
		    (presentation-type presentation))
	 (t gesture))))

WITH-INPUT-CONTEXT is all you really need in order to write your
GET-USER-INPUT function.  (Note that neither it, nor your
implementation, solves the original problem, though, which involved
suppressing echoing of typed input.)

Here is your function rewritten.  (I have not tested this code because
I am not sitting in front of a CLIM.)

(defun get-user-input (stream &optional (desired-type t))
  (with-input-context (desired-type) 
                      (object type)
       (read-gesture :stream stream)
    (t (values object type))))

[A perhaps more appropriate implementation for your purposes puts the
READ-GESTURE inside a loop, so that a mouse click is required to
0, answered,,


Main Index | Thread Index