walabulu4 Posted May 31, 2021 Share Posted May 31, 2021 Hi, I am fairly new to UltraAppKit so sorry if this is a dumb question. I want to make an array of Nodes in my TreeView widget. Currently this is the code I am using but you cannot it won't let me use auto in an array, so I was wondering how to go about doing it. auto tagTree_genreTagNode = main_tagTree->root->AddNode("Genre Type Tags"); tagTree_genreTagNode->AddNode("Slots"); tagTree_genreTagNode->AddNode("Idle Clicker"); tagTree_genreTagNode->AddNode("Card"); tagTree_genreTagNode->AddNode("Shooting"); tagTree_genreTagNode->AddNode("Roguelike"); tagTree_genreTagNode->AddNode("Conway Game of Life Auto Game"); auto tagTree_otherTagNode = main_tagTree->root->AddNode("Other Tags"); auto tagTree_platformNode = main_tagTree->root->AddNode("Possible Platforms"); auto treeArray[3] = { tagTree_genreTagNode , tagTree_otherTagNode, tagTree_platformNode }; //Does not work. Cheers. Quote Link to comment Share on other sites More sharing options...
Josh Posted May 31, 2021 Share Posted May 31, 2021 I like to use STL arrays because they have bounds checking, you can retrieve the size, and other nice features: array<shared_ptr<Widget>, 3> treeArray = {node1,node2,node3}; 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
walabulu4 Posted June 1, 2021 Author Share Posted June 1, 2021 Just what I needed! Thank you! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.