17.1.3 Examples of Formatting Tables 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

CLIM 2.0 User's Guide - OCT 1998

Generated with Harlequin WebMaker