anchor.diff:  	   (allocate-space child new-width new-height)
   	   (incf y new-height))))
   
  --
  -;;; INTERACTOR-PANE class
  -
  -(defclass clim-stream-pane (output-recording-stream basic-pane)
  -  ()
  -  )
  -
  -(defmethod compose-space ((pane clim-stream-pane))
  -  (setf (pane-space-requirement pane)
  -    (make-space-requirement :width 400
  -			    :max-width 800
  -			    :height 200
  -			    :max-height 200)))
  -
  --
  -;;; INTERACTOR-PANE class
  -
  -(defclass interactor-pane (clim-stream-pane)
  -  ()
  -  )
  -
  -(defmethod initialize-instance :after ((pane interactor-pane) &rest args)
  +
  +;; TABLE PANE
  +
  +(defclass table-pane (composite-pane)
  +  ((number-per-line :type integer :initform 0 :accessor table-pane-number)))
  +
  +(defmethod initialize-instance :before ((table table-pane)
  +					&rest args
  +					&key contents
  +					&allow-other-keys)
     (declare (ignore args))
  -#+ignore  (let ((cursor (stream-text-cursor pane)))
  -    (setf (cursor-visibility cursor) t)))
  -
  --
  -;;; APPLICATION-PANE class
  -
  -(defclass application-pane (clim-stream-pane)
  -  ((incremental-redisplay :initarg :incremental-redisplay
  -			  :initform nil)
  -   (display-function :initarg :display-function
  -		     :initform nil)
  -   )
  -  )
  -
  -+  (unless (reduce #'= (mapcar #'length contents))
  +    (error "The variable contents hasn't the good format")))
  +
  +(defmethod initialize-instance :after ((table table-pane)
  +				       &rest args
  +				       &key contents
  +				       &allow-other-keys)
  +  (declare (ignore args))
  +  (loop for children in contents
  +	do (loop for child in children
  +		 do (sheet-adopt-child table child)))
  +  (setf (table-pane-number table) (length (first contents))))
  +
  +;(defmethod initialize-instance :after ((table table-pane)
  +;				       &rest args
  +;				       &key contents
  +;				       &allow-other-keys)
  +;  (declare (ignore args))
  +;  (when contents
  +;    (if (reduce #'= (mapcar #'length contents))
  +;	(progn 
  +;	  (loop for children in contents
  +;		do (loop for child in children
  +;			 do (sheet-adopt-child table child)))
  +;	  (setf (table-pane-number table) (length (first contents))))
  +;	(error "The variable contents hasn't the good format"))))
  +
  +(defmacro tabling ((&rest options) &body contents)
  +  `(if (pane-grid-p (list ,@contents))
  +       (make-pane 'grid-pane ,@options :contents (list ,@contents))
  +       (make-pane 'table-pane ,@options :contents (list ,@contents))))
  +
  +(defmacro change-formated-spaces (spaces space-direction-accessor)
  +  `(setf (,space-direction-accessor space)
  +	 (reduce #'max (mapcar #'(lambda (l)
  +				  (reduce #'+ (mapcar #',space-direction-accessor l)))
  +			      ,spaces))))
  +
  +(defun format-children (children number-per-line)
  +  (let ((formated))
  +    (do ((i 0 (+ i number-per-line)))
  +	((= i (length children)))
  +	(setf formated (append formated
  +			       (list (subseq children i (+ i number-per-line))))))
  +    formated))
  +
  +(defmethod compute-space ((table table-pane))
  +  (let* ((space (make-space-requirement))
  +	 (h-spaces (format-children (mapcar #'pane-space-requirement (sheet-children table))
  +				    (table-pane-number table)))
  +	 (v-spaces (apply #'mapcar #'list h-spaces)))
  +    (change-formated-spaces h-spaces space-requirement-width)
  +    (change-formated-spaces h-spaces space-requirement-min-width)
  +    (change-formated-spaces h-spaces space-requirement-max-width)
  +    (change-formated-spaces v-spaces space-requirement-height)
  +    (change-formated-spaces v-spaces space-requirement-min-height)
  +    (change-formated-spaces v-spaces space-requirement-max-height)
  +    (setf (pane-space-requirement table) space)
  +    space))
  +
  +(defun find-collums-and-rows-size (table)
  +  (let* ((number-per-line (table-pane-number table))
  +         (children-request (mapcar #'pane-space-requirement (sheet-children table)))
  +         (width-requests (mapcar #'space-requirement-width children-request))
  +         (height-requests (mapcar #'space-requirement-height children-request))
  +         (height-requests (format-children height-requests number-per-line))
  +         (width-requests (apply #'mapcar #'list 
  +                                (format-children width-requests number-per-line))))
  +    (list
  +     (mapcar #'(lambda (l) (reduce #'max l)) width-requests)
  +     (mapcar #'(lambda (l) (reduce #'max l)) height-requests))))
  +
  +(defmethod allocate-space ((table table-pane) width height)
  +  (let ((h-percent (/ width (space-requirement-width (pane-space-requirement table))))
  +        (v-percent (/ height (space-requirement-height (pane-space-requirement table))))
  +        (table-cell-sizes (find-collums-and-rows-size table))
  +        (contents (format-children (sheet-children table) (table-pane-number table)))
  +	(x 0)
  +        (y 0))
  +    (loop for line-children in contents
  +          for height in (second table-cell-sizes)
  +          for new-height = (floor (* h-percent height))
  +          do (loop for child in line-children
  +                   for width in (first table-cell-sizes)
  +                   for new-width = (floor (* v-percent width))
  +                   do (setf (sheet-region child)
  +                            (make-bounding-rectangle x y (+ x new-width) (+ y new-height)))
  +		      (allocate-space child new-width new-height)
  +		      (incf x new-width))
  +	     (setf x 0)
  +	     (incf y new-height))))
  +
  +;(defmethod sheet-adopt-child :before ((table table-pane) child)
  +;  (declare (ignore child))
  +;  (when (= (length (sheet-children table)) (table-pane-number table))
  +;    (error "The table can't adopt more childs than specified by the table-number")))
  +
  +(defmethod sheet-disowned-child :before ((table table-pane) child &key (error-p t))
  +  (declare (ignore child error-p))
  +  (error "The table pane can't disown one of its child"))
  +
  +
  +;; GRID PANE
  +
  +(defclass grid-pane (table-pane) ()
  +  (:documentation "Be careful : each cell has its width equal to its height"))
  +
  +(defun pane-grid-p (contents)
  +  (let ((spaces (mapcar #'pane-space-requirement (apply #'append contents))))
  +    (apply #'= (mapcan #'(lambda (pane)
  +			    (list (space-requirement-width pane)
  +				  (space-requirement-height pane)))
  +					       
  +			spaces))))
  +	    
  +
  +
  +(defmethod allocate-space ((grid grid-pane) width height)
  +  (let* ((new-height (/ height (/ (length (sheet-children grid)) (table-pane-number grid))))
  +	 (new-width (/ width (table-pane-number grid)))
  +	 (contents (format-children (sheet-children grid) (table-pane-number grid)))
  +	 (x 0)
  +	 (y 0))
  +    (loop for children in contents
  +	  do (loop for child in children
  +		   do (setf (sheet-region child)
  +			    (make-bounding-rectangle x y (+ x new-width) (+ y new-height)))
  +		      (allocate-space child new-width new-height)
  +		      (incf x new-width))
  +        	  (setf x 0)
  +		  (incf y new-height))))
  +
  +
  +;; SPACER PANE
  +
  +(defclass spacer-pane (composite-pane) ())
  +
  +(defmacro spacing ((&rest options) &body contents)
  +  `(make-pane 'spacer-pane ,@options :contents (list ,@contents)))
  +
  +(defmethod compute-space ((spacer spacer-pane))
  +  (let ((space (make-space-requirement))
  +	(margin-space (pane-space-requirement spacer))
  +	(child-space (pane-space-requirement (first (sheet-children spacer)))))
  +    (setf (space-requirement-width space) 
  +	  (+ (space-requirement-width margin-space)
  +	     (space-requirement-width child-space))
  +	  (space-requirement-min-width space) 
  +	  (+ (space-requirement-min-width margin-space)
  +	     (space-requirement-min-width child-space))
  +	  (space-requirement-max-width space) 
  +	  (+ (space-requirement-max-width margin-space)
  +	     (space-requirement-max-width child-space))
  +	  (space-requirement-height space) 
  +	  (+ (space-requirement-height margin-space)
  +	     (space-requirement-height child-space))
  +	  (space-requirement-min-height space) 
  +	  (+ (space-requirement-min-height margin-space)
  +	     (space-requirement-min-height child-space))
  +	  (space-requirement-max-height space) 
  +	  (+ (space-requirement-max-height margin-space)
  +	     (space-requirement-max-height child-space))
  +	  (pane-space-requirement spacer) space)
  +    space))
  +
  +(defmethod allocate-space ((spacer spacer-pane) width height)
  +  (let* ((h-percent (/ width (space-requirement-width (pane-space-requirement spacer))))
  +	 (v-percent (/ height (space-requirement-height (pane-space-requirement spacer))))
  +	 (child (first (sheet-children spacer)))
  +	 (request (pane-space-requirement child))
  +	 (new-width (floor (* h-percent (space-requirement-width request))))
  +	 (new-height (floor (* v-percent (space-requirement-height request)))))
  +    (setf (sheet-region child)
  +	  (make-bounding-rectangle 0 0 new-width new-height))
  +    (allocate-space child new-width new-height)))
  +
   
   ;;; BORDER-PANE class
   
  
positive.code: ;;; Boston, MA  02111-1307  USA.
  
  (in-package :CLIM-INTERNALS)
  
  (defclass space-requirement ()
    ((width :initform 0
  
negative.code: 	   (allocate-space child new-width new-height)
  	   (incf x new-width))))
  
  
  ;;; VBOX-PANE class
  
  