Suddenly, whenever I add a snippet, I lose the place in the tree.
I think the problem lies in the way I catch events from the tree node. Using afterselect means I can get keyboard driven changes, but it also means that when I rebuild the tree from scratch, I cause scene to be selected on its own, which resets the indices.
I think I'm going to have maintain the tree as I go.
There was something about using a data provider to supply the tree and having it update automatically, which could save some time - always assuming that I don't spend more time enabling the data provider. This is supposed to be a cheap-and-cheerful dev tool, not precision engineering...
Update:
I did bit of fiddling, and it seems be fairly straight forward. I already know the index where I want to insert the node.
The only trouble is that "inserting" here means overwriting any node already at that index, rather than adding a new node, so I need to shuffle everythign down by hand... Let's see how that goes...
For anything other then adding on the end, the loop isn't terminating. Let's not make assumptions - something is looping. It might be an event loop, or a bug somewhere else.
Enough for one night. I'll dig it out tomorrow.
No comments:
Post a Comment