anchor.diff:  ;;; Button box
   
   (defun create-bbox-in-frame (class frame-label spacing width height layout)
  -    (make-instance 'frame
  -     :label frame-label
  -     :child (make-instance class
  -	     :border-width 5 :layout layout :spacing spacing
  -	     :child-min-width width :child-min-height height
  -	     :children
  -	     (list
  -	      (button-new "OK")
  -	      (button-new "Cancel")
  -	      (button-new "Help")))))
  -
  -(define-test-window create-button-box "Button Boxes"
  -  (setf (container-border-width window) 10)
  -  (make-instance 'vbox
  -   :parent window
  -   :children
  -   (list
  -    (list
  -     (make-instance 'frame
  -      :label  "Horizontal Button Boxes"
  -      :child
  -      (make-instance 'vbox
  -       :border-width 10
  -       :children
  -       (mapcar
  -	#'(lambda (args)
  -	    (list (apply #'create-bbox-in-frame 'hbutton-box args) :padding 5))
  -	'(("Spread" 40 85 20 :spread) ("Edge" 40 85 20 :edge)
  -	  ("Start" 40 85 20 :start) ("End" 40 85 20 :end)))))
  -     :padding 10)
  -
  -    (list
  -     (make-instance 'frame
  -      :label "Vertical Button Boxes"
  -      :child
  -      (make-instance 'hbox
  -       :border-width 10
  -       :children
  -       (mapcar
  -	#'(lambda (args)
  -	    (list (apply #'create-bbox-in-frame 'vbutton-box args) :padding 5))
  -	'(("Spread" 30 85 20 :spread) ("Edge" 30 85 20 :edge)
  -	  ("Start" 30 85 20 :start) ("End" 30 85 20 :end)))))
  -     :padding 10))))
  +  (declare (ignore width height))
  +  (make-instance 'frame
  +   :label frame-label
  +   :child (make-instance class
  +	   :border-width 5 :layout-style layout :spacing spacing
  +;	   :child-min-width width :child-min-height height
  +	   :child (make-instance 'button :label "OK")
  +	   :child (make-instance 'button :label "Cancel")
  +	   :child (make-instance 'button :label "Help"))))
  +
  +(define-toplevel create-button-box (window "Button Boxes")
  +  (make-instance 'v-box
  +   :parent window :border-width 10 :spacing 10 :show-all t
  +   :child (make-instance 'frame
  +	   :label "Horizontal Button Boxes"
  +	   :child (make-instance 'v-box
  +		   :border-width 10 :spacing 10
  +		   :children (mapcar	
  +			      #'(lambda (args)
  +				  (apply #'create-bbox-in-frame 
  +				   'h-button-box args))
  +			      '(("Spread" 40 85 20 :spread) 
  +				("Edge" 40 85 20 :edge)
  +				("Start" 40 85 20 :start) 
  +				("End" 40 85 20 :end)))))
  +   :child (make-instance 'frame
  +	   :label "Vertical Button Boxes"
  +	   :child (make-instance 'h-box
  +		   :border-width 10 :spacing 10
  +		   :children (mapcar
  +			      #'(lambda (args)
  +				  (apply #'create-bbox-in-frame
  +				   'v-button-box args))
  +			      '(("Spread" 30 85 20 :spread) 
  +				("Edge" 30 85 20 :edge)
  +				("Start" 30 85 20 :start) 
  +				("End" 30 85 20 :end)))))))
   
   
   ;; Buttons
   
  -(define-standard-dialog create-buttons "Buttons" 
  +(define-simple-dialog create-buttons (dialog "Buttons")
     (let ((table (make-instance 'table
  -	        :rows 3 :columns 3 :homogeneous nil
  +	        :n-rows 3 :n-columns 3 :homogeneous nil
   		:row-spacing 5 :column-spacing 5 :border-width 10
  -		:parent main-box))
  -	(buttons (make-array 0 :adjustable t :fill-pointer t)))
  -    (dotimes (n 9)
  -      (vector-push-extend
  -       (button-new (format nil "button~D" (1+ n)))  buttons))
  +		:parent dialog))
  +	  (buttons (loop
  +		    for n from 1 to 10
  +		    collect (make-instance 'button 
  +			     :label (format nil "button~D" (1+ n))))))
  +
       (dotimes (column 3)
         (dotimes (row 3)
  -	(let ((button (aref buttons (+ (* 3 row) column)))
  -	      (button+1 (aref buttons (mod (+ (* 3 row) column 1) 9))))
  +	(let ((button (nth (+ (* 3 row) column) buttons))
  +	      (button+1 (nth (mod (+ (* 3 row) column 1) 9) buttons)))
   	  (signal-connect button 'clicked
   			  #'(lambda ()
   			      (if (widget-visible-p button+1)
   				  (widget-hide button+1)
   				(widget-show button+1))))
  -	  (table-attach table button column (1+ column) row (1+ row)))))))
  +	  (table-attach table button column (1+ column) row (1+ row)))))
  +    (widget-show-all table)))
   
   
   ;; Calenadar
   
  -(define-standard-dialog create-calendar "Calendar"
  -  (setf (container-border-width main-box) 10)
  -  (make-instance 'calendar :parent main-box))
  +(define-simple-dialog create-calendar (dialog "Calendar")
  +  (make-instance 'v-box
  +   :parent dialog :border-width 10 :show-all t
  +   :child (make-instance 'calendar)))
   
   
   ;;; Check buttons
   
  -(define-standard-dialog create-check-buttons "Check Buttons"
  -  (setf (container-border-width main-box) 10)
  -  (setf (box-spacing main-box) 10)
  -  (dotimes (n 3)
  -    (make-instance 'check-button
  -     :label (format nil "Button~D" (1+ n))
  -     :parent main-box)))
  +(define-simple-dialog create-check-buttons (dialog "Check Buttons")
  +  (make-instance 'v-box
  +   :border-width 10 :spacing 10 :parent dialog :show-all t
  +   :children (loop
  +	      for n from 1 to 3
  +	      collect (make-instance 'check-button
  +		       :label (format nil "Button~D" n)))))
   
   
   
   ;;; Color selection
   
  -(let ((color-dialog nil))
  -  (defun create-color-selection ()
  -    (unless color-dialog
  -      (setq
  -       color-dialog
  -       (make-instance 'color-selection-dialog
  -	:title "Color selection dialog" :position :mouse
  -	:allow-grow nil :allow-shrink nil
  -	:signals
  -	(list (list 'destroy #'(lambda () (widget-destroyed color-dialog))))))
  -
  -      (with-slots (main-box colorsel) color-dialog
  -        (make-instance 'hbutton-box
  -	 :border-width 10 :layout :edge :visible t
  -	 :children
  -	 (list
  -	  (create-check-button
  -	   "Show Opacity" '(setf color-selection-use-opacity-p) nil colorsel)
  -	  (create-check-button
  -	   "Show Palette" '(setf color-selection-use-palette-p) nil colorsel))
  -	 :parent main-box)
  -	
  -	(signal-connect
  -	 (color-selection-dialog-ok-button color-dialog) 'clicked
  -	 #'(lambda ()
  -	     (let ((color (color-selection-color colorsel)))
  -	       (format t "Selected color: ~A~%" color)
  -	       (setf (color-selection-color colorsel) color))))
  -	(signal-connect
  -	 (color-selection-dialog-cancel-button color-dialog) 'clicked
  -	 #'widget-destroy :object color-dialog)))
  -       
  -    (if (not (widget-visible-p color-dialog))
  -	(widget-show color-dialog)
  -      (widget-destroy color-dialog))))
  -
  -
  +(define-dialog create-color-selection (dialog "Color selection dialog" 
  +				       'color-selection-dialog
  +				       :allow-grow nil :allow-shrink nil)
  +  (with-slots (action-area colorsel) dialog
  +;;     This seg faults for some unknown reason
  +;;     (let ((button (make-instance 'check-button :label "Show Palette")))
  +;;       (dialog-add-action-widget dialog button
  +;;        #'(lambda () 
  +;;  	  (setf 
  +;;  	   (color-selection-has-palette-p colorsel)
  +;;  	   (toggle-button-active-p button)))))
  +
  +    (container-add action-area 
  +     (create-check-button "Show Opacity" 
  +      #'(lambda (state)
  +	  (setf (color-selection-has-opacity-control-p colorsel) state))))
  +
  +    (container-add action-area
  +     (create-check-button "Show Palette" 
  +      #'(lambda (state) 
  +	  (setf (color-selection-has-palette-p colorsel) state))))
  +
  +    (signal-connect dialog :ok
  +     #'(lambda ()
  +	 (let ((color (color-selection-current-color colorsel)))
  +	   (format t "Selected color: ~A~%" color)
  +	   (setf (color-selection-current-color colorsel) color)
  +	   (widget-hide dialog))))
  +
  +    (signal-connect dialog :cancel #'widget-destroy :object t)))
   
   
   ;;; Cursors
  
positive.code: 
  ;;; Radio buttons
  
  (define-standard-dialog create-radio-buttons "Radio buttons"
    (setf (container-border-width main-box) 10)
    (setf (box-spacing main-box) 10)
  
    (map nil
     #'(lambda (button)
         (box-pack-start main-box button t t 0))
     (create-radio-button-group '("button1" "button2" "button3") 1)))
  
  
  ;;; Rangle controls
  
  (define-standard-dialog create-range-controls "Range controls"
    (setf (container-border-width main-box) 10)
    (setf (box-spacing main-box) 10)
    (let ((adjustment (adjustment-new 0.0 0.0 101.0 0.1 1.0 1.0)))
      (make-instance 'hscale
       :width 150 :height 30 :adjustment adjustment
       :update-policy :delayed :digits 1 :draw-value t :parent main-box)
      (make-instance 'hscrollbar
       :adjustment adjustment :update-policy :continuous :parent main-box)))
  
  
  
  ;;; Reparent test
  
  (define-standard-dialog create-reparent "reparent"
    (let ((box2 (hbox-new nil 5))
  	(label (label-new "Hellow World")))
      (setf (container-border-width box2) 10)
      (box-pack-start main-box box2 t t 0)
  
      (let ((frame (frame-new "Frame 1"))
  	  (box3 (vbox-new nil 5))
  	  (button (button-new "switch")))
        (box-pack-start box2 frame t t 0)
        
        (setf (container-border-width box3) 5)
        (container-add frame box3)
        
        (signal-connect
         button 'clicked
         #'(lambda ()
  	   (widget-reparent label box3)))
        (box-pack-start box3 button nil t 0)
        
        (box-pack-start box3 label nil t 0)
        (signal-connect
         label 'parent-set
         #'(lambda (old-parent)
  	   (declare (ignore old-parent)))))
      
      (let ((frame (frame-new "Frame 2"))
  	  (box3 (vbox-new nil 5))
  	  (button (button-new "switch")))
        (box-pack-start box2 frame t t 0)
  	
        (setf (container-border-width box3) 5)
        (container-add frame box3)
        
        (signal-connect
         button 'clicked
         #'(lambda ()
  	   (widget-reparent label box3)))
        (box-pack-start box3 button nil t 0))))
  
  
  
  ;;; Rulers
  
  (define-test-window create-rulers "rulers"
    (setf (widget-width window) 300)
    (setf (widget-height window) 300)
    (setf (widget-events window) '(:pointer-motion :pointer-motion-hint))
  
    (let ((table (make-instance 'table
  	        :rows 2 :columns 2
  		:parent window)))
  
      (let ((ruler (make-instance 'hruler
  		  :metric :centimeters
  		  :lower 100.0 :upper 0.0
  		  :position 0.0 :max-size 20.0)))
        (signal-connect
         window 'motion-notify-event
         #'(lambda (event) (widget-event ruler event)))
        (table-attach table ruler 1 2 0 1 :y-options '(:fill)))
  
      (let ((ruler (make-instance 'vruler
  		  :lower 5.0 :upper 15.0
  		  :position 0.0 :max-size 20.0)))
        (signal-connect
         window 'motion-notify-event
         #'(lambda (event) (widget-event ruler event)))
        (table-attach table ruler 0 1 1 2 :x-options '(:fill)))))
  
  
  
  ;;; Scrolled window
  
  (define-standard-dialog create-scrolled-windows "Scrolled windows"
    (let* ((scrolled-window
  	  (make-instance 'scrolled-window
  	   :parent main-box
  	   :border-width 10
  	   :vscrollbar-policy :automatic
  	   :hscrollbar-policy :automatic))
  	 (table
  	  (make-instance 'table
  	   :rows 20 :columns 20 :row-spacing 10 :column-spacing 10
  	   :focus-vadjustment (scrolled-window-vadjustment scrolled-window)
  	   :focus-hadjustment (scrolled-window-hadjustment scrolled-window))))
  
  
negative.code: 	(paned-pack2 paned child resize (not shrink))))))
  
  (defun create-pane-options (paned frame-label label1 label2)
    (let* ((frame (make-instance 'frame :label frame-label :border-width 4))
  	 (table (make-instance 'table :n-rows 3 :n-columns 2 :homogeneous t 
  			              :parent frame)))
  
      (table-attach table (label-new label1) 0 1 0 1)
      (let ((check-button (make-instance 'check-button :label "Resize")))
        (table-attach table check-button 0 1 1 2)
        (signal-connect
         check-button 'toggled #'toggle-resize :object (paned-child1 paned)))
      (let ((check-button (make-instance 'check-button :label "Shrink")))
        (table-attach table check-button 0 1 2 3)
        (setf (toggle-button-active-p check-button) t)
        (signal-connect
         check-button 'toggled #'toggle-shrink :object (paned-child1 paned)))
  
      (table-attach table (label-new label2) 1 2 0 1)
      (let ((check-button (make-instance 'check-button :label "Resize")))
        (table-attach table check-button 1 2 1 2)
        (setf (toggle-button-active-p check-button) t)
        (signal-connect
         check-button 'toggled #'toggle-resize :object (paned-child2 paned)))
      (let ((check-button (make-instance 'check-button :label "Shrink")))
        (table-attach table check-button 1 2 2 3)
        (setf (toggle-button-active-p check-button) t)
        (signal-connect
         check-button 'toggled #'toggle-shrink :object (paned-child2 paned)))
      frame))
  
  (define-toplevel create-panes (window "Panes")
    (let* ((hpaned (make-instance 'h-paned
  		  :child1 (make-instance 'frame
  			   :width-request 60 :height-request 60
  			   :shadow-type :in 
  			   :child (button-new "Hi there"))
  		  :child2 (make-instance 'frame			    
  			   :width-request 80 :height-request 60
  			   :shadow-type :in)))
  	 (vpaned (make-instance 'v-paned
  		  :border-width 5
  		  :child1 hpaned
  		  :child2 (make-instance 'frame
  			   :width-request 80 :height-request 60
  			   :shadow-type :in))))
      
      (make-instance 'v-box
       :parent window
       :child-args '(:expand nil)
       :child (list vpaned :expand t)
       :child (create-pane-options hpaned "Horizontal" "Left" "Right")
       :child (create-pane-options vpaned "Vertical" "Top" "Bottom"))))
    
  
  ;;; Progress bar
  
       
  