anchor.diff:             ellipse-button rectangle-button)
            (scrolling (:width 600 :height 400) canvas))
          (horizontally (:height 30) clear undo redo)
  -       status)))
  -;  #+nil
  -   (:top-level (clim-fig-frame-top-level)))
  -
  -(defmethod clim-fig-frame-top-level ((frame application-frame) &key)
  +       command
  +       status))))
  +
  +(define-presentation-to-command-translator add-figure
  +    (blank-area com-add-figure clim-fig
  +                :gesture :select ; XXX
  +                :echo nil
  +                :tester ((window) (typep window 'canvas-pane)))
  +  (x y)
  +  (list x y))
  +
  +(define-presentation-to-command-translator move-figure
  +    (figure com-move-figure clim-fig
  +            :gesture :menu ; XXX
  +            :echo nil)
  +  (presentation x y)
  +  (list presentation x y))
  +
  +(defmethod run-frame-top-level :around ((frame clim-fig) &key &allow-other-keys)
     (let ((*standard-input* (frame-standard-input frame))
   	(*standard-output* (frame-standard-output frame))
   	(*query-io* (frame-query-io frame)))
       (setf (clim-fig-output-record frame)
             (stream-current-output-record *standard-output*)
             (clim-fig-status frame)
  -          (find-if #'(lambda (pane) (typep pane 'text-field-pane))
  -                   (frame-panes frame)))
  -    (catch 'exit
  -      (clim-extensions:simple-event-loop))
  -    (frame-exit frame)))
  +          (find-pane-named frame 'status))
  +    (call-next-method)))
  +
  +(define-clim-fig-command com-exit ()
  +  (frame-exit *application-frame*))
  +
  +(define-clim-fig-command com-undo ()
  +  (let* ((output-history (clim-fig-output-record *application-frame*))
  +	 (record-count (output-record-count output-history))
  +         (record (and (not (zerop record-count))
  +		      (elt (output-record-children output-history)
  +			   (1- record-count)))))
  +    (if record
  +        (progn
  +          (erase-output-record record *standard-output*)
  +          (push record (clim-fig-redo-list *application-frame*)))
  +        (beep))))
  +
  +(define-clim-fig-command com-redo ()
  +  (let* ((record (pop (clim-fig-redo-list *application-frame*))))
  +    (if record
  +        (progn
  +          (stream-add-output-record *standard-output* record)
  +          (replay record *standard-output* (bounding-rectangle record)))
  +        (beep))))
  +
  +(define-clim-fig-command com-clear ()
  +  (setf (clim-fig-redo-list *application-frame*)
  +        (append (coerce (output-record-children (clim-fig-output-record
  +						 *application-frame*))
  +			'list)
  +                (clim-fig-redo-list *application-frame*)))
  +  (window-clear *standard-output*))
  +
  +(define-clim-fig-command (com-add-figure :name nil) ((x 'real) (y 'real))
  +  (handle-draw-object (find-pane-named *application-frame* 'canvas) x y))
  +
  +(define-clim-fig-command (com-move-figure :name nil)
  +    ((figure 'figure) (x 'real) (y 'real))
  +  (handle-move-object (find-pane-named *application-frame* 'canvas)
  +                      figure x y))
  +
  +(make-command-table 'file-command-table
  +		    :errorp nil
  +		    :menu '(("Exit" :command com-exit)))
  +
  +(make-command-table 'edit-command-table
  +		    :errorp nil
  +		    :menu '(("Undo" :command com-undo)
  +			    ("Redo" :command com-redo)
  +                            ("Clear" :command com-clear)))
  +
  +(make-command-table 'menubar-command-table
  +		    :errorp nil
  +		    :menu '(("File" :menu file-command-table)
  +                            ("Edit" :menu edit-command-table)))
  
positive.code:                                dashes
                                 (line-style-dashes line-style))))
  
  (define-command com-exit ()
    (throw 'exit nil))
  
  (define-command com-undo ()
    (let* ((output-history (clim-fig-output-record *application-frame*))
  	 (record-count (output-record-count output-history))
           (record (and (not (zerop record-count))
  		      (elt (output-record-children output-history)
  			   (1- record-count)))))
      (if record
          (progn
            (erase-output-record record *standard-output*)
            (push record (clim-fig-redo-list *application-frame*)))
          (beep))))
  
  (define-command com-redo ()
    (let* ((record (pop (clim-fig-redo-list *application-frame*))))
      (if record
          (progn
            (stream-add-output-record *standard-output* record)
            (replay record *standard-output* (bounding-rectangle record)))
          (beep))))
  
  (define-command com-clear ()
    (setf (clim-fig-redo-list *application-frame*)
          (append (coerce (output-record-children (clim-fig-output-record
  						 *application-frame*))
  			'list)
                  (clim-fig-redo-list *application-frame*)))
    (window-clear *standard-output*))
  
  (make-command-table 'file-command-table
  		    :errorp nil
  		    :menu '(("Exit" :command com-exit)))
  
  (make-command-table 'edit-command-table
  		    :errorp nil
  		    :menu '(("Undo" :command com-undo)
  			    ("Redo" :command com-redo)
                              ("Clear" :command com-clear)))
  
  (make-command-table 'menubar-command-table
  		    :errorp nil
  		    :menu '(("File" :menu file-command-table)
                              ("Edit" :menu edit-command-table)))
  
  (define-application-frame clim-fig ()
    ((drawing-mode :initform :line :accessor clim-fig-drawing-mode)
     (output-record :accessor clim-fig-output-record)
  
negative.code:    (fill-mode :initform nil :accessor clim-fig-fill-mode)
     (constrict-mode :initform nil :accessor clim-fig-constrict-mode)
     (status :initform nil :accessor clim-fig-status))
    (:menu-bar menubar-command-table)
    (:panes
     (canvas (make-pane 'canvas-pane
                        :display-time nil))
     (line-width-slider :slider
  		      :label "Line Width"
  		      :value 1
  