7.7. TABULAR LAYOUTS
87
none
horizontal
vertical
both
If the components do not expand horizontally and vertically, the one must spec
ify how they should be placed inside the row or col. There are several choices,
listed below:
north northeast northwest east west
south southeast southwest center
So, we can modify the running example and have the labels in the row stay the
same size, and be centered in the row, as follows:
(define w
(window "Hello"
(row 'none 'center white
(label "red" red)
(label "green" green)
(label "yellow" yellow)
(label "blue" blue)
)))
(.pack w)
(.show w)
Note that one must precede the specifiers with a single quote. Also observe that
we can specify the color of the row this is the color of the space between the
components in the row.
One can also lay components out in a tabular form with R rows and C
columns. There are two procedures for doing this:
(grid
R C ....)
(table R C ....)
The difference between them is that each of the cells in the grid is exactly the
same size, where as in the table the cells may vary in size. Continuing with our
example, we can make a table of four labels as follows:
(define w
(window "Hello"
(table 2 2
(label "red" red)
(label "green" green)
(label "yellow" yellow)
(label "blue" blue)
)))
(.pack w)
(.show w)