Index: main/grid/display.lisp
===================================================================
--- main/grid/display.lisp	(revision main,53)
+++ main/grid/display.lisp	(revision main,55)
@@ -5,5 +5,4 @@
 (defclass grid ()
   ((data :initarg :data)
-   (column-widths :type (vector (integer 1)) :initarg :column-widths)
    (header-rows :type (integer 0) :initarg :header-rows)
    (header-columns :type (integer 0) :initarg :header-columns)
@@ -12,9 +11,7 @@
    (column-scroll :type (integer 0) :initform 0 :accessor column-scroll)))
 
-(defun make-grid (window data column-widths
-                  &key (header-rows 0) (header-columns 0))
+(defun make-grid (window data &key (header-rows 0) (header-columns 0))
   (make-instance 'grid
                  :data data
-                 :column-widths (coerce column-widths 'vector)
                  :header-rows header-rows
                  :header-columns header-columns
@@ -41,6 +38,8 @@
 
 (defun column-offset (grid column)
-  (with-slots (column-widths header-columns column-scroll) grid
-    (let ((base (+ header-columns column-scroll)))
+  (with-slots (data header-columns column-scroll) grid
+    (let ((base (+ header-columns column-scroll))
+          (column-widths (mapcar (peval 'column-width data)
+                                 (range header-columns))))
       (multiple-value-bind (in-header in-data) (column-split grid column)
         (let ((w1 (reduce '+ column-widths :end in-header))
@@ -99,15 +98,15 @@
 
 (defun draw (grid)
-  (with-slots (data column-widths header-columns window column-scroll) grid
+  (with-slots (data header-columns window column-scroll) grid
     (erase window)
     (let ((x 0))
       (dotimes (i header-columns)
         (draw-column grid i x)
-        (incf x (svref column-widths i)))
+        (incf x (column-width data i)))
       (do ((i (+ header-columns column-scroll) (incf i)))
           ((or (>= i (columns data))
                (> x (nth-value 1 (size window)))))
         (draw-column grid i x)
-        (incf x (svref column-widths i))))))
+        (incf x (column-width data i))))))
 
 
Index: main/grid/model.lisp
===================================================================
--- main/grid/model.lisp	(revision main,26)
+++ main/grid/model.lisp	(revision main,55)
@@ -2,4 +2,8 @@
 
 
+
+(defgeneric rows (grid-data)
+  (:documentation
+   "Returns the number of rows of data."))
 
 #|(defgeneric header-rows (grid-data)
@@ -10,4 +14,8 @@
   (:method (grid-data) 0))|#
 
+(defgeneric columns (grid-data)
+  (:documentation
+   "Returns the number of columns of data."))
+
 #|(defgeneric header-columns (grid-data)
   (:documentation
@@ -17,17 +25,9 @@
   (:method (grid-data) 0))|#
 
-#|(defgeneric column-width (grid-data column)
+(defgeneric column-width (grid-data column)
   (:documentation
    "Returns the width of the column, as the total number of characters
 requested for this column.  The count may be less than the length of
-the maximal item in the column."))|#
-
-(defgeneric rows (grid-data)
-  (:documentation
-   "Returns the number of rows of data."))
-
-(defgeneric columns (grid-data)
-  (:documentation
-   "Returns the number of columns of data."))
+the maximal item in the column."))
 
 (defgeneric item (grid-data row column)
Index: main/grid/package.lisp
===================================================================
--- main/grid/package.lisp	(revision main,53)
+++ main/grid/package.lisp	(revision main,55)
@@ -1,4 +1,4 @@
 (defpackage #:grid
   (:use #:cl #:dso-util #:tui-display-string #:tui-output #:tui-window)
-  (:export #:rows #:columns #:item #:uses-display-strings #:row-scroll
-           #:column-scroll #:make-grid #:draw))
+  (:export #:rows #:columns #:column-width #:item #:uses-display-strings
+           #:row-scroll #:column-scroll #:make-grid #:draw))
Index: main/grid/test.lisp
===================================================================
--- main/grid/test.lisp	(revision main,53)
+++ main/grid/test.lisp	(revision main,55)
@@ -12,4 +12,7 @@
 
 (defmethod columns ((gd test)) 10)
+
+(defmethod column-width ((gd test) column)
+  5)
 
 (defmethod item ((gd test) row column)
@@ -34,10 +37,9 @@
 
 (defun test-draw ()
-  (let ((data (make-instance 'test))
-        (widths (make-sequence 'vector 10 :initial-element 5)))
+  (let ((data (make-instance 'test)))
     (with-screen (screen)
       (clear screen)
       (with-subwindow (window screen 5 16 0 0)
-        (let ((grid (make-grid window data widths :header-columns 1 :header-rows 1)))
+        (let ((grid (make-grid window data :header-columns 1 :header-rows 1)))
           (flet ((try (i)
                    (setf (row-scroll grid) i)
@@ -55,5 +57,5 @@
             (try 99))))
       (clear screen)
-      (let ((grid (make-grid screen data widths :header-columns 1 :header-rows 1)))
+      (let ((grid (make-grid screen data :header-columns 1 :header-rows 1)))
         (draw grid)
         (read-key screen)))))
