anchor.diff:  (defclass text-widget (sys.gray:fundamental-character-output-stream)
     ((cursor-x :initarg :cursor-x :accessor cursor-x)
      (cursor-y :initarg :cursor-y :accessor cursor-y)
  +   (line :initarg :line :accessor cursor-line)
      (foreground :initarg :foreground :accessor window-foreground-colour)
      (background :initarg :background :accessor window-background-colour)
      (framebuffer :initarg :framebuffer :reader framebuffer)
  
positive.code: (defmethod window-close-event ((window text-window))
    (close-window window))
  
  (defmethod sys.gray:stream-write-char ((stream text-widget) character)
    (let ((fb (framebuffer stream))
          (x (cursor-x stream))
          (y (cursor-y stream))
          (win-width (widget-width stream))
          (win-height (widget-height stream)))
      (cond
        ((eql character #\Newline)
         ;; Clear the next line.
         (setf (cursor-x stream) 0
               y (if (> (+ y 16 16) win-height)
                     0
                     (+ y 16))
               (cursor-y stream) y)
         (bitset 16 win-width (window-background-colour stream) fb (+ (widget-y stream) y) (widget-x stream)))
        (t (let ((width (sys.int::unifont-glyph-width character)))
             (when (> (+ x width) win-width)
               ;; Advance to the next line.
               ;; Maybe should clear the end of the current line?
               (setf x 0
                     y (if (> (+ y 16 16) win-height)
                           0
                           (+ y 16))
                     (cursor-y stream) y)
               (bitset 16 win-width (window-background-colour stream) fb (+ (widget-y stream) y) (widget-x stream)))
             (bitset 16 width (window-background-colour stream) fb (+ (widget-y stream) y) (+ (widget-x stream) x))
             (let ((glyph (sys.int::map-unifont-2d character)))
               (when glyph
                 (bitset-argb-xrgb-mask-1 16 width (window-foreground-colour stream)
                                          glyph 0 0
                                          fb (+ (widget-y stream) y) (+ (widget-x stream) x))))
             (incf x width)
             (setf (cursor-x stream) x))))))
  
  
negative.code:    (width :initarg :width :accessor widget-width)
     (height :initarg :height :accessor widget-height))
    (:default-initargs :x 0 :y 0
                       :cursor-x 0 :cursor-y 0 :line 0
                       :foreground (make-colour *default-foreground-colour*)
                       :background (make-colour *default-background-colour*)))
  
  