Jump to content

UltraAppKit - How to make array of Nodes??


walabulu4
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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};

 

  • Thanks 1

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

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...