MCPcopy Create free account
hub / github.com/Raais/ImStudio / DisplayNode

Method DisplayNode

src/third-party/imgui/imgui_demo.cpp:4746–4773  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4744 int ChildIdx;
4745 int ChildCount;
4746 static void DisplayNode(const MyTreeNode* node, const MyTreeNode* all_nodes)
4747 {
4748 ImGui::TableNextRow();
4749 ImGui::TableNextColumn();
4750 const bool is_folder = (node->ChildCount > 0);
4751 if (is_folder)
4752 {
4753 bool open = ImGui::TreeNodeEx(node->Name, ImGuiTreeNodeFlags_SpanFullWidth);
4754 ImGui::TableNextColumn();
4755 ImGui::TextDisabled("--");
4756 ImGui::TableNextColumn();
4757 ImGui::TextUnformatted(node->Type);
4758 if (open)
4759 {
4760 for (int child_n = 0; child_n < node->ChildCount; child_n++)
4761 DisplayNode(&all_nodes[node->ChildIdx + child_n], all_nodes);
4762 ImGui::TreePop();
4763 }
4764 }
4765 else
4766 {
4767 ImGui::TreeNodeEx(node->Name, ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_Bullet | ImGuiTreeNodeFlags_NoTreePushOnOpen | ImGuiTreeNodeFlags_SpanFullWidth);
4768 ImGui::TableNextColumn();
4769 ImGui::Text("%d", node->Size);
4770 ImGui::TableNextColumn();
4771 ImGui::TextUnformatted(node->Type);
4772 }
4773 }
4774 };
4775 static const MyTreeNode nodes[] =
4776 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected