Thank you for reporting this bug. We will make it our priority to review this report.
[2.0 Trunk] Bug in TreeStore when inserting a new item?
I'm trying to insert a new TreeItem at a specific index by modifying the TreeStore. The problem is that the new item is added as a last child instead of the specified position.
The TreeStore has the setMonitorChanges set to true, and when inserting the new item I create a ChangeEvent and call notify:
Now, in the TreeStore the onModelChange will execute, and the ChangeEventSource.Add will be chosen. The add method will insert the new child using as index the number of children under the given parent instead of the index from ChangeEvent:
ChangeEvent evt = new ChangeEvent(Add, this);
(TreeStore, line 186).
insert(parent, item, getChildCount(parent), addChildren);
My question is what is the solution to insert a new treeItem at a specific position? Should the TreeStore be modified so that it takes into consideration the index set in the ChangeEvent?