anchor.diff:                                       :frame-manager fm)))
       (with-look-and-feel-realization (fm fr))
       fr))
  +
  +(defun foofoo ()
  +  (open-window-stream))
  +
  +
  +
  +(defmethod text-size ((sheet sheet) string &rest more)
  +  (apply #'text-size (sheet-medium sheet) string more))
  +(defmethod text-style-ascent (ts (sheet sheet))
  +  (text-style-ascent ts (sheet-medium sheet)))
  +(defmethod text-style-descent (ts (sheet sheet))
  +  (text-style-descent ts (sheet-medium sheet)))
  +
  +;;;;;;
  +
  +#||
  +(defclass list-pane (value-gadget)
  +  ((mode        :initarg :mode
  +                :initform :some-of
  +                :reader list-pane-mode
  +                :type (member :one-of :some-of))
  +   (items       :initarg :items
  +                :initform nil
  +                :reader list-pane-items
  +                :type sequence)
  +   (name-key    :initarg :name-key
  +                :initform #'princ-to-string
  +                :reader list-pane-name-key
  +                :documentation "A function to be applied to items to gain a printable representation")
  +   (value-key   :initarg :value-key
  +                :initform #'identity
  +                :reader list-pane-value-key
  +                :documentation "A function to be applied to items to gain its value 
  +                                for the purpose of GADGET-VALUE.")
  +   (test        :initarg :test
  +                :initform #'eql
  +                :reader list-pane-test
  +                :documentation "A function to compare two items for equality.") ))
  +
  +(defclass generic-list-pane (basic-pane list-pane permanent-medium-sheet-output-mixin)
  +  ((item-strings :initform nil
  +                 :documentation "Vector of item strings.")
  +   (selected-items :initform nil
  +                   :documentation "List of indexes of selected items.")
  +   ))
  +
  +(defmethod generic-list-pane-item-strings ((pane generic-list-pane))
  +  (with-slots (item-strings) pane
  +    (or item-strings
  +        (setf item-strings
  +          (map 'vector (lambda (item)
  +                         (let ((s (funcall (list-pane-name-key pane) item)))
  +                           (if (stringp s)
  +                               s
  +                             (princ-to-string s)))) ;defensive programming!
  +               (list-pane-items pane))))))
  +
  +(defmethod compose-space ((pane generic-list-pane))
  +  (let* ((n (length (generic-list-pane-item-strings pane)))
  +         (w (reduce #'max (map 'vector (lambda (item-string)
  +                                         (text-size pane item-string))
  +                               (generic-list-pane-item-strings pane))
  +                    :initial-value 0))
  +         (h (* n (+ (text-style-ascent (pane-text-style pane) pane)
  +                    (text-style-descent (pane-text-style pane) pane)))))
  +    (make-space-requirement :width w :height h
  +                            :min-width w :min-height h
  +                            :max-width w :max-height h)))
  +
  +#+NIL
  +(defmethod allocate-space ((pane generic-list-pane) width height)
  +  )
  +
  +(defmethod handle-repaint ((pane generic-list-pane) region)
  +  (with-slots (selected-items) pane
  +    (let* ((a (text-style-ascent (pane-text-style pane) pane))
  +           (d (text-style-descent (pane-text-style pane) pane)))
  +      (multiple-value-bind (x1 y1 x2 y2) (bounding-rectangle* (sheet-region pane))
  +        (loop
  +            for i from 0
  +            for x across (generic-list-pane-item-strings pane) do
  +              (let ((y (+ a (* i (+ a d)))))
  +                (cond ((member i selected-items)
  +                       (draw-rectangle* pane x1 (- y a) x2 (+ y d))
  +                       (draw-text* pane x 0 y :ink +background-ink+))
  +                      (t
  +                       (draw-rectangle* pane x1 (- y a) x2 (+ y d) :ink +background-ink+)
  +                       (draw-text* pane x 0 y)))))))))
  +
  +(defmethod handle-event ((pane generic-list-pane) (event pointer-button-press-event))
  +  (multiple-value-bind (mx my) (values (pointer-event-x event) (pointer-event-y event))
  +    (let ((k (floor my (+ (text-style-ascent (pane-text-style pane) pane)
  +                          (text-style-descent (pane-text-style pane) pane))))
  +          (n (length (generic-list-pane-item-strings pane))))
  +      (if (member k (slot-value pane 'selected-items))
  +          (setf (slot-value pane 'selected-items) (delete k (slot-value pane 'selected-items)))
  +        (pushnew k (slot-value pane 'selected-items)))
  +      (dispatch-repaint pane +everywhere+)
  +      )))
  +
  +(defmethod handle-event ((sheet immediate-repainting-mixin) (event window-repaint-event))
  +  (dispatch-repaint sheet (window-event-region event)))
  +||#
positive.code:   (make-space-requirement :width 200
  			  :height 200))
  
  (defmethod compose-space :around ((pane pane))
    (with-slots (sr-width sr-height sr-max-width
                          sr-max-height sr-min-width sr-min-height
                          space-requirement) pane
      (unless space-requirement
        (let ((request (call-next-method)))
  	(when (spacing-p pane)
  	  (with-slots (margin-width margin-height
                                      margin-max-width margin-max-height
                                      margin-min-width margin-min-height) pane
  	    (let ((child (first (sheet-children pane))))
  	      (setf sr-width (+ margin-width (sr-width child))
  		    sr-height (+ margin-height (sr-height child))
  		    sr-max-width (+ margin-max-width (sr-max-width child))
  		    sr-max-height (+ margin-max-height (sr-max-height child))
  		    sr-min-width (+ margin-min-width (sr-min-width child))
  		    sr-min-height (+ margin-min-height (sr-min-height child)) ))))
          (let* ((max-width (or sr-max-width
                                sr-width
                                (space-requirement-max-width request)))
                 (max-height (or sr-max-height
                                 sr-height
                                 (space-requirement-max-height request)))
                 (min-width (or sr-min-width
                                sr-width
                                (space-requirement-min-width request)))
                 (min-height (or sr-min-height
                                 sr-height
                                 (space-requirement-min-height request)))
                 (width (clamp (or sr-width (space-requirement-width request))
                               min-width
                               max-width))
                 (height (clamp (or sr-height (space-requirement-height request))
                                min-height
                                max-height)))
            (setf space-requirement
                  (make-space-requirement
                   :width width
                   :height height
                   :max-width max-width
                   :max-height max-height
                   :min-width min-width
                   :min-height min-height))))
        (compute-extremum pane))
      space-requirement))
  
  (defmethod allocate-space ((pane pane) width height)
    (resize-sheet pane width height))
  
  (defmethod compute-extremum ((pane pane))
    (declare (ignorable pane))
    nil)
  
  (defmethod change-space-requirements ((pane pane) &rest rest)
    (declare (ignore rest))
    (values))
  
  (defmethod note-space-requirements-changed (sheet (pane pane))
    (declare (ignore sheet))
    (setf (pane-space-requirement pane) nil)
  
negative.code:                        :client (first (sheet-children viewport))
                         :drag-callback
                         #'(lambda (gadget new-value)
                             (scroll-extent (gadget-client gadget)
                                            0
                                            (* new-value 
                                               (- (bounding-rectangle-max-y
                                                   (sheet-region
                                                    (gadget-client gadget)))
                                                  (bounding-rectangle-max-y
                                                   (sheet-region
                                                    viewport)))))
                             #+NIL
                             (let ((old-x (bounding-rectangle-min-x
                                           (pane-viewport-region
                                            (gadget-client gadget)))))
  