Skip to main content
Jun 9, 2023 7:20 PM UTC
Solved

Creo toolkit implement tree in UI

I am working with Creo 8. I would like to implement a dialog with tree view in it. The tree has 3 columns. I have spent few of hours trying to understand API to create and populate tree. But not able to figure how to do it. With C++ I wasn't even able to add node to tree. With C I could add node but not able to figure how to add column. If anyone has tried this already I would appreciate the help in from of sample code.

 

FWIW -

 

For C I have following working code to add node -

 

    auto status = ProUITreeColumnCreate("dialog_material_assign_assembly",
                                        "MatAssignTree", nullptr, L"Test", 10,
                                        PROUITREECOL_LEFT);
    status = ProUITreeNodeInsert("dialog_material_assign_assembly",
                                 "MatAssignTree", "root", L"Root Node", nullptr,
                                 "node_type", nullptr);
 
With C++ I tried I this but its not working -
 
    uifcTree_ptr ptrMatAssignTree =
            uifcTreeFind("dialog_material_assign_assembly", "MatAssignTree");
    auto ptrItem = uifcTreeItemDefine("root_item");
    ptrItem->SetText("Root Item");

    auto ptrPos = uifcItemPositionData::Create();
    ptrPos->SetIndex(0);
    ptrPos->SetIsBefore(false);
    ptrMatAssignTree->InsertItem(ptrItem, ptrPos);

   

 

 

 

wang666TkAnswer
Jan 8, 2024 11:49 AM UTC

If you want add column in tree ui component.Set attribute [.TreeAttributeWindow] for [True]。

edit .res file with notepad,add attribute (.TreeAttributeWindow  True) in (TreeAttributeWindow testTree)

 

3 replies

wang666TkAnswer
Jan 8, 2024 11:49 AM UTC

If you want add column in tree ui component.Set attribute [.TreeAttributeWindow] for [True]。

edit .res file with notepad,add attribute (.TreeAttributeWindow  True) in (TreeAttributeWindow testTree)

 

Sep 5, 2025 8:11 AM UTC

Hello, have you figure out your problem? 

I am faced with the same question like yours. I can hardly understand the logic of composing the node in UI Tree.

Can you send me some code about UI Tree, this will help me absolutely.

Thank you.

Sep 5, 2025 5:46 PM UTC

Hello, As suggested in accepted solution I modified my .res file to add following line (.<your_tree_view_name>TreeAttributeWindow  True) Replace <your_tree_view_name> with actual tree view name. Then I used ProToolkit API ProUITreeNodeInsert() to insert node in tree. It worked for me.