11.4. From a List to a Tree

Writing a custom model for a tree is a bit trickier than a simple list model, but follows the same pattern. Basically you just need to extend the above model to cater for the case of children. You could do this by keeping track of the whole tree hierarchy in the CustomList structure, using GLib N-ary trees for example, or you could do this by keeping track of each row's children within the row's CustomRecord structure, keeping only a pointer to the (invisible) root record in the CustomList structure.

TODO: do we need anything else here?