Ok, there are several issues about the TreeGadget:
1st: on PB's side:
The Item handling functions (changing Text/State of Items) for
TreeGadget get slower, the more Items the Gadget contains. However,
the AddGadgetItem() command should not be slow at all at the moment,
as it doesn't contain any code that might be a bottleneck when dealing
with a high number of items.
Maybe you are also using a SetGadgetItemState() or something to change
the new items state or something that slows down the whole thing?
However, the TreeGadget code is beeing improved for v3.70, and all
commands should be faster then.
2nd: on M$ side:
Go have a look at the Remarks section here:
http://msdn.microsoft.com/library/defau ... tcount.asp
First of all, this tells me, that the TreeView control on Windows is not
intended for that large amounts of data. I think the concept behind it is
more to dinamically add data to the Control, when the user wants to see
them, and free not needed recources, when the user collapses a Node.
Therefore it provides possibilities, to add subitems, only if they are visible
for example. However, implementing this stuff for purebasic would make
the whole TreeGadget a very complex thing, although parts of it will be
improved now (for example adding Items wherever you want

).
However, as to what I have read, the TreeView control is capable of
holding very large amounts of data, only counting them is buggy
What's the point now? I guess, that because the TreeView control isn't designed to be used with that large amouts of data, that's the reason why
it slows down so much. However, this is just a guess.
Another much bigger problem is, that at the moment, PB get's confused
when addimg more than 32767 Items, because the Item count gets
negative. All Items added behind the 32767th Item will get wrong Item
numbers by PB!
So much about the bad news, let's come to the good ones...
As I allready said, the code is beeing improved, so on v3.7, all commands
should be faster. The limit of data will also be solved, so that you will
hopefully get the whole 32bit range for Item numbers, so this won't be
a problem any more. (the max number of Items will then be 1073741823,
as this is the largest positive number a PB LONG can hold

)
Another improvement will be the support of the Position parameter in
AddGadgetItem(), so the TreeGadget will get more dynamic.
My Tip for you now is... stay tuned for 3.7, should work better then
Timo