Next Prev Up Top Contents Index Formatting a Table With Irregular Graphics in the Cells

The example3 function shows how you can format a table in which each cell contains graphics of different sizes.

(defun example3 (&optional (items *alphabet*)   
                 &key (stream *standard-output*) (n-columns 6)
                      inter-row-spacing inter-column-spacing)
      (stream :inter-row-spacing inter-row-spacing  
              :inter-column-spacing inter-column-spacing)
   (do ()
       ((null items))
     (clim:formatting-row (stream)
        (do ((i 0 (1+ i)))
            ((or (null items) (= i n-columns)))
          (clim:formatting-cell (stream)   
             (clim:draw-polygon* stream 
                                (list 0 0 (* 10 (1+ (random 3)))
                                      5 5 (* 10 (1+ (random 3))))
                                :filled nil)
            (pop items)))))))

Evaluating (example3 *alphabet* :stream *my-stream*) shows this table:


Figure 28. Example3 Table

Common Lisp Interface Manager 2.0 User Guide - 14 Dec 2001

Next Prev Up Top Contents Index