How do I put arbitrary elements in a tree?
The short answer is, you don't. Trees are designed to support text content only. This is done for performance reasons, and allows a tree to handle thousands or millions of rows without any performance issues. In fact, a tree with only a few rows can be displayed in about the same time as a tree with a million rows. This is because a tree only needs to handle the rows that are currently displayed.
However, trees do support two special types of content besides text: images and progress meters. Mozilla's download manager uses a progress meter to display the percentage downloaded so far.