dcjones/compose — pull request #4 by timholy (2012-12-21 13:58:10+00:00)
Title: RFC: add contents() to reveal tree structure

I'm trying to understand Compose, and I found that the `contents()` utility in the attached commit seemed handy. If you think it's useful, please accept it (and feel free to modify as you see fit). To use it, just type `contents(c)` where `c` is a `CanvasTree`.

Also, I tried writing this:
```
# Draw rectangle outlining all canvases
function mark_canvases(c::Canvas, ops...)
lc = Array(Canvas, 0)
for cc in c.children
push(lc, mark_canvases(cc, ops...))
end
if !isempty(lc)
c.children = Compose.list(lc)
end
ub = c.unit_box
compose(c, rectangle(ub.x0, ub.y0, ub.width, ub.height), fill(nothing), ops...)
end
```
This version yields an SVG that appears blank. I comment out the recursion (everything above `ub = ...`), then it produces a figure with a box around it. Any hints about what I'm doing wrong?