CLIM mail archive


Re: help for editing text.

I was trying to modify your code below to accept multi-line input.
In theory, changing the activation character from #\newline to
something like #\control-d should work, right?  Well, it let
me enter multiple lines, but control-d was ignored.  Any clues?

jeff morrill

  Date: Fri, 24 Jul 1992 14:39-0400
  From: "John G. Aspinall" <>
  ;;; -*- Mode: Lisp; Package: CLIM-USER; Syntax: Common-Lisp; Lowercase: Yes -*-
  (defun read-note (&optional default-note)
    (with-menu (stream)
      ;; Set up the pop-up window the way we want to see it
      (setf (clim::cursor-visibility (clim::stream-text-cursor stream)) :off)
      (clim::window-set-inside-size  stream
        (* 60 (stream-character-width stream #\Space))
        (* 10 (stream-line-height stream)))
      (write-string "Enter a note:" stream)
      (fresh-line stream)
      (setf (stream-text-margin stream) (bounding-rectangle-width (window-viewport stream)))
      (window-expose stream)
  	(with-input-editing (stream)
  	  ;; Put the default note into the input buffer and ensure that
  	  ;; we never do it again
  	  (when default-note
  	    (replace-input stream default-note :rescan t)
  	    (setq default-note nil))
  	  ;; Now get the input from the user
  	  (with-activation-characters ('(#\Newline) :override t)
  		(read-token stream)
  	      ;; Eat the activation character
  	      (read-gesture :stream stream :timeout 0))))
        (setf (clim::cursor-visibility (clim::stream-text-cursor stream)) :inactive))))



Main Index | Thread Index