U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » TreeCtrl » Iterate over all nodes
Iterate over all nodes [message #54337] Thu, 25 June 2020 12:03 Go to next message
Maginor is currently offline  Maginor
Messages: 44
Registered: May 2019
Member
Hi, is there a simple way to iterate over all nodes in the tree, not just the open ones (without keeping a separate list of the node ids somewhere)?

I could do it recursively, but I'd rather not. I just need a list of all the node ids.
Re: Iterate over all nodes [message #54481 is a reply to message #54337] Wed, 29 July 2020 12:30 Go to previous message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
Maginor wrote on Thu, 25 June 2020 12:03
Hi, is there a simple way to iterate over all nodes in the tree, not just the open ones (without keeping a separate list of the node ids somewhere)?

I could do it recursively, but I'd rather not. I just need a list of all the node ids.


Yes. Recursively... Smile

If you knew the highest id in TreeCtrl, you could probably use IsValid too. But I am not sure we should go that way. Of course, "id" is just index to internal vector of Nodes, but somehow I would prefer this to be hidden just in case implementation has to change for some reason.

Mirek
Previous Topic: off by 1 dynamic tree with sql: SOLVED
Next Topic: OptionTree problems
Goto Forum:
  


Current Time: Sun Apr 26 20:14:51 GMT+2 2026

Total time taken to generate the page: 0.00443 seconds