Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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: 30
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: 12844
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
Goto Forum:
  


Current Time: Fri Oct 30 08:12:55 CET 2020

Total time taken to generate the page: 0.01100 seconds