GTK+ 2.0 Tree View Tutorial | ||
---|---|---|
<<< Previous | Chapter 11. Writing Custom Models | Next >>> |
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?
<<< Previous | Home | Next >>> |
Example: A Simple Custom List Model | Up | Additional interfaces, here: the GtkTreeSortable interface |