anchor.diff:      (refresh win)))
   
   (defmethod draw ((area textarea))
  -  (with-accessors ((pos element-position) (width width) (height height)
  -                   (inbuf buffer) (dptr display-pointer) (win window)) area
  +  (with-accessors ((pos element-position) (width width) (height height) (inbuf buffer)
  +                   (selected selectedp) (dptr display-pointer) (win window) (style style)) area
       (clear area)
  -    (let ((y 0)
  +    (let ((fg-style (if selected (getf style :selected-foreground) (getf style :foreground)))
  +          (y 0)
             (x 0))
         ;; start at (0 0)
         (goto win pos (list y x))
  
positive.code:     :initform      0
      :type          (or null integer)
      :accessor      cursor-position-y
      :documentation "Y position (row) in the textarea where the next character will be added.")
  
     (cursor-position-x
      :initform      0
      :type          (or null integer)
      :accessor      cursor-position-x
      :documentation "X position (column) in the textarea where the next character will be added."))
  
    (:default-initargs :keymap 'textarea-map)
    
  
negative.code: (defmethod clear ((area textarea) &key)
    "Clear the textarea by overwriting the underlying window with #\space.
  
  The char can be set by setting the :background and :selected-background style.
  
  If the underlying window has a background char, that will be used to
  clear the window."
    (with-accessors ((pos element-position) (width width) (height height)
                     (win window) (selected selectedp) (style style)) area
      (let* ((bg-style (if selected (getf style :selected-background) (getf style :background)))
             (bg-char  (if (getf bg-style :simple-char) (getf bg-style :simple-char) #\space)))
        (setf (cursor-position win) pos)
        ;; return to the start of the area after the clearing
        (save-excursion win
          (loop for i from 0 to (1- height) do
            (loop for j from 0 to (1- width) do
              (goto win pos (list i j))
              ;; adding a simple space inherits the attributes and colors
              ;; from the background char of the window.
              (add win bg-char :style bg-style)))))))
  
  (defmethod update-cursor-position ((area textarea))
    (with-accessors ((pos element-position) (win window) (dptr display-pointer)
  