code: func TreeView(nextSlide func()) (title string, content tview.Primitive) {
  	treeNextSlide = nextSlide
  	tree.SetBorder(true).
  		SetTitle("TreeView")
  
  	// Add nodes.
  	var add func(target *node) *tview.TreeNode
  	add = func(target *node) *tview.TreeNode {
  		node := tview.NewTreeNode(target.text).
  			SetSelectable(target.expand || target.selected != nil).
  			SetExpanded(target == rootNode).
  			SetReference(target)
  		if target.expand {
  			node.SetColor(tcell.ColorGreen)
  		} else if target.selected != nil {
  			node.SetColor(tcell.ColorRed)
  		}
  		for _, child := range target.children {
  			node.AddChild(add(child))
  		}
  		return node
  	}
  	root := add(rootNode)
  	tree.SetRoot(root).
  		SetCurrentNode(root).
  		SetSelectedFunc(func(n *tview.TreeNode) {
  			original := n.GetReference().(*node)
  			if original.expand {
  				n.SetExpanded(!n.IsExpanded())
  			} else if original.selected != nil {
  				original.selected()
  			}
  		})
  
  	treeCode.SetText(strings.Replace(treeAllCode, "$$$", treeBasicCode, -1)).
  		SetBorderPadding(1, 1, 2, 0)
  
  	return "Tree", tview.NewFlex().
  		AddItem(tree, 0, 1, true).
  		AddItem(treeCode, codeWidth, 1, false)
  }
docs: // TreeView demonstrates the tree view.