Hey, I’m writing a little game that has to render a tree (the data structure, not the plant ). Each node of the tree should be rendered as a Box. Each box has some text in it, a button to remove the node from the tree (including any children), and a button to add another child node.
The problem I’m having now is: How could I delete an element from the tree? I think the approach with
indexedMap isn’t working for this, since I can’t remove elements from the tree this way, only update the labels. I think I’d have to use the tree zipper for this, but I’m having trouble even rendering the tree this way.
Could someone show me an example for how to do something like this?