anchor.diff:        1
         (signum value)))
   
  -(defmethod handle-event ((pane canvas-pane) (event pointer-motion-event))
  -  (with-slots (first-point-x first-point-y canvas-pixmap) pane
  -      (when (and first-point-x first-point-y canvas-pixmap)
  -	(let* ((x (pointer-event-x event))
  -	       (y (pointer-event-y event))
  -               (radius-x (- x first-point-x))
  -               (radius-y (- y first-point-y))
  -	       (pixmap-width (round (bounding-rectangle-width (sheet-region pane))))
  -	       (pixmap-height (round (bounding-rectangle-height (sheet-region pane)))))
  -	  (with-slots (clim-demo::current-color clim-demo::drawing-mode clim-demo::constrict-mode) *application-frame*
  -          (set-status-line (format nil "~:(~A~) from (~D,~D) to (~D,~D)~%"
  -                                   clim-demo::drawing-mode
  -                                   (round first-point-x) (round first-point-y)
  -                                   (round x) (round y)))
  -	    (with-output-recording-options (pane :record nil)
  -	      (copy-from-pixmap canvas-pixmap 0 0 pixmap-width pixmap-height pane 0 0)
  -              (when clim-demo::constrict-mode
  -                (let ((radius-max (max (abs radius-x) (abs radius-y))))
  -                  (setf radius-x (* (signum-1 radius-x) radius-max)
  -                        radius-y (* (signum-1 radius-y) radius-max)
  -                        x (+ first-point-x radius-x)
  -                        y (+ first-point-y radius-y))))
  -	      (case clim-demo::drawing-mode
  -		(:line
  -                 (when clim-demo::constrict-mode
  -                   (if (= (- (pointer-event-x event) first-point-x) radius-x)
  -                       (setf y first-point-y)
  -                       (setf x first-point-x)))
  -		 (draw-line* pane first-point-x first-point-y x y
  -			     :ink clim-demo::current-color :line-thickness 1))
  -                (:arrow
  -                 (when clim-demo::constrict-mode
  -                   (if (= (- (pointer-event-x event) first-point-x) radius-x)
  -                       (setf y first-point-y)
  -                       (setf x first-point-x)))
  -		 (draw-arrow* pane first-point-x first-point-y x y
  -                              :ink clim-demo::current-color :line-thickness 1
  -                              :to-head t :head-width 20 :head-length 20))
  -		(:rectangle
  -		 (draw-rectangle* pane first-point-x first-point-y x y :filled nil
  -				  :ink clim-demo::current-color :line-thickness 1))
  -                (:ellipse
  -                 (draw-ellipse* pane first-point-x first-point-y radius-x 0 0 radius-y :filled nil
  -                                :ink clim-demo::current-color :line-thickness 1)))))))))
  +(defun handle-draw-object (pane event)
  +  (let* ((x1 (pointer-event-x event))
  +         (y1 (pointer-event-y event))
  +         (pixmap-width (round (bounding-rectangle-width (sheet-region pane))))
  +         (pixmap-height (round (bounding-rectangle-height (sheet-region pane))))
  +         (canvas-pixmap (allocate-pixmap pane pixmap-width pixmap-height)))
  +    (copy-to-pixmap pane 0 0 pixmap-width pixmap-height canvas-pixmap)
  +    (tracking-pointer (pane)
  +      (:pointer-motion (&key window x y)
  +         (declare (ignore window))
  +         (set-status-line (format nil "~:(~A~) from (~D,~D) to (~D,~D)~%"
  +                                  (slot-value *application-frame*
  +                                              'drawing-mode)
  +                                  (round x1) (round y1)
  +                                  (round x) (round y)))
  +         (with-output-recording-options (pane :record nil)
  +           (copy-from-pixmap canvas-pixmap 0 0 pixmap-width pixmap-height pane 0 0)
  +           (draw-figure pane
  +                        x1 y1 x y
  +                        :fastp t)))
  +      (:pointer-button-release (&key event x y)
  +         (when (= (pointer-event-button event)
  +                  +pointer-left-button+)
  +           (set-status-line " ")
  +           (copy-from-pixmap canvas-pixmap 0 0 pixmap-width pixmap-height pane 0 0)
  +           (deallocate-pixmap canvas-pixmap)
  +           (draw-figure pane
  +                        x1 y1
  +                        x y)
  +           (setf (clim-fig-redo-list *application-frame*) nil)
  +           (return-from handle-draw-object))))))
   
   (defmethod handle-event ((pane canvas-pane) (event pointer-button-release-event))
  -  (when (= (pointer-event-button event) +pointer-left-button+)
  -    (with-slots (first-point-x first-point-y canvas-pixmap) pane
  -      (let ((pixmap-width (round (bounding-rectangle-width (sheet-region pane))))
  -	    (pixmap-height (round (bounding-rectangle-height (sheet-region pane)))))
  -        (set-status-line " ")
  -
  -	(when (and first-point-x first-point-y canvas-pixmap)
  -          (copy-from-pixmap canvas-pixmap 0 0 pixmap-width pixmap-height pane 0 0)
  -          (deallocate-pixmap canvas-pixmap)
  -          (setf canvas-pixmap nil)
  -	  (with-slots (clim-demo::line-style
  -                       clim-demo::current-color
  -                       clim-demo::fill-mode
  -                       clim-demo::constrict-mode) *application-frame*
  -	    (let* ((x (pointer-event-x event))
  -		   (y (pointer-event-y event))
  -		   (radius-x (- x first-point-x))
  -                   (radius-y (- y first-point-y)))
  -              (when clim-demo::constrict-mode
  -                (let ((radius-max (max (abs radius-x) (abs radius-y))))
  -                  (setf radius-x (* (signum-1 radius-x) radius-max)
  -                        radius-y (* (signum-1 radius-y) radius-max)
  -                        x (+ first-point-x radius-x)
  -                        y (+ first-point-y radius-y))))
  -	      (case (clim-demo::clim-fig-drawing-mode *application-frame*)
  -		(:line
  -                 (when clim-demo::constrict-mode
  -                   (if (= (- (pointer-event-x event) first-point-x) radius-x)
  -                       (setf y first-point-y)
  -                       (setf x first-point-x)))
  -		 (draw-line* pane first-point-x first-point-y x y
  -			     :ink clim-demo::current-color
  -                             :line-style clim-demo::line-style))
  -		(:arrow
  -                 (when clim-demo::constrict-mode
  -                   (if (= (- (pointer-event-x event) first-point-x) radius-x)
  -                       (setf y first-point-y)
  -                       (setf x first-point-x)))
  -                 (with-new-output-record (pane)
  -                   (draw-arrow* pane first-point-x first-point-y x y
  -                                :ink clim-demo::current-color
  -                                :line-style clim-demo::line-style
  -                                :to-head t :head-width 20 :head-length 20)))
  -		(:rectangle
  -		 (draw-rectangle* pane first-point-x first-point-y x y :filled clim-demo::fill-mode
  -				  :ink clim-demo::current-color
  -                                  :line-style clim-demo::line-style))
  -                (:ellipse
  -		 (draw-ellipse* pane first-point-x first-point-y radius-x 0 0 radius-y
  -                                :filled clim-demo::fill-mode
  -				:ink clim-demo::current-color :line-style clim-demo::line-style))))
  -	    (setf (clim-demo::clim-fig-redo-list *application-frame*) nil))
  -	  (setf first-point-x nil
  -		first-point-y nil)))))
     (when (= (pointer-event-button event) +pointer-right-button+)
       (with-slots (first-point-x first-point-y selected-object) pane
         (when selected-object
  
positive.code:   (handle-event pane event))
  )
  
  (defmethod handle-event ((pane canvas-pane) (event pointer-button-press-event))
    (when (= (pointer-event-button event) +pointer-left-button+)
      (with-slots (first-point-x first-point-y canvas-pixmap) pane
        (let ((pixmap-width (round (bounding-rectangle-width (sheet-region pane))))
  	    (pixmap-height (round (bounding-rectangle-height (sheet-region pane)))))
  	(setq first-point-x (pointer-event-x event))
  	(setq first-point-y (pointer-event-y event))
  	(with-slots (clim-demo::line-style clim-demo::current-color clim-demo::drawing-mode) *application-frame*
  	  (case clim-demo::drawing-mode
  	    (:point
  	     (draw-point* pane first-point-x first-point-y
  			  :ink clim-demo::current-color
                            :line-style clim-demo::line-style))))
  	(setf canvas-pixmap (allocate-pixmap pane pixmap-width pixmap-height))
          (copy-to-pixmap pane 0 0 pixmap-width pixmap-height canvas-pixmap))))
    (when (= (pointer-event-button event) +pointer-right-button+)
      (with-slots (first-point-x first-point-y selected-object) pane
        (setq first-point-x (pointer-event-x event)
              first-point-y (pointer-event-y event))
        (setf selected-object (search-selected-object (climi::pane-output-history pane)
                                                      first-point-x
                                                      first-point-y)))))
  
  
negative.code:               first-point-x nil
                first-point-y nil)))))
  
  (defun clim-fig ()
    (loop for port in climi::*all-ports*
        do (destroy-port port))
    (setq climi::*all-ports* nil)
   (run-frame-top-level (make-application-frame 'clim-fig))
   ;(setq frame (make-application-frame 'clim-fig))
   ;(setq fm (frame-manager frame))
   ;(setq port (climi::frame-manager-port fm))
   ;(setq pane (first (frame-panes frame)))
   ;(setq medium (sheet-medium pane))
   ;(setq graft (graft frame))
   ;(setq vbox (climi::frame-pane frame))
   ;(run-frame-top-level frame)
   )
  
  (defun make-colored-button (color &key width height)
    (make-pane 'push-button-pane
  