I could post code, but sometimes it causes one to miss the forest because of the trees. Lets start with concepts, then I can post code if needed.
Lets consider the algorithm needed given the methods of an hlist to move a node, with all its children, before another node. So lets say that I have
n1 n1.c1 n1.c2 n2 n2.c1 n2.c2
and I want to move n2 and all its children, before n1.
It seems that all I can do is either 'add' and item to the hlist, or delete it, and all its children if there are any.
It would then seem that I would need to delete n2 and hence all its children, then re-create n2, specifying its location in the hlist::add method, so that it is before n1. I could then re-create all its children, simply specifying the entrypath.
This is hugely wasteful. Especially if the deleted node had many descendants.
It seems that the hlist has good methods for the initial creation of a tree, but once created, re-distributing nodes seems painful.
What am I missing?
..Otto
In reply to Re^2: Tk::Hlist item movement
by otto
in thread Tk::Hlist item movement
by otto
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |