All Manuals > Common Lisp Interface Manager 2.0 User's Guide > Chapter 17 Formatted Output > 17.1 Formatting Tables in CLIM > 17.1.3 Examples of Formatting Tables

NextPrevUpTopContentsIndex

17.1.3.3 Formatting a Table With Regular Graphic Elements

The example2 function shows how you can draw graphics within the cells of a table. Each cell contains a rectangle of the same dimensions.

(defun example2 (&key (stream *standard-output*) 
                      y-spacing 
                      x-spacing)
  (clim:formatting-table
   (stream :y-spacing y-spacing
           :x-spacing x-spacing)
   (dotimes (i 3)
     (clim:formatting-row
      (stream)
      (dotimes (j 3)
        (clim:formatting-cell
         (stream)
         (clim:draw-rectangle* stream 10 10 50 50)))))))

Evaluating (example2 :stream *my-stream* :y-spacing 5) shows this table:

 

Figure 27. Example2 Table

Common Lisp Interface Manager 2.0 User's Guide - 3 Mar 2015

NextPrevUpTopContentsIndex