MCPcopy Create free account
hub / github.com/Aegel5/SimpleSwitcher / CollapsingHeader

Method CollapsingHeader

imgui_tiny_app/imgui/imgui_widgets.cpp:7282–7289  ·  view source on GitHub ↗

CollapsingHeader returns true when opened but do not indent nor push into the ID stack (because of the ImGuiTreeNodeFlags_NoTreePushOnOpen flag). This is basically the same as calling TreeNodeEx(label, ImGuiTreeNodeFlags_CollapsingHeader). You can remove the _NoTreePushOnOpen flag if you want behavior closer to normal TreeNode().

Source from the content-addressed store, hash-verified

7280// CollapsingHeader returns true when opened but do not indent nor push into the ID stack (because of the ImGuiTreeNodeFlags_NoTreePushOnOpen flag).
7281// This is basically the same as calling TreeNodeEx(label, ImGuiTreeNodeFlags_CollapsingHeader). You can remove the _NoTreePushOnOpen flag if you want behavior closer to normal TreeNode().
7282bool ImGui::CollapsingHeader(const char* label, ImGuiTreeNodeFlags flags)
7283{
7284 ImGuiWindow* window = GetCurrentWindow();
7285 if (window->SkipItems)
7286 return false;
7287 ImGuiID id = window->GetID(label);
7288 return TreeNodeBehavior(id, flags | ImGuiTreeNodeFlags_CollapsingHeader, label);
7289}
7290
7291// p_visible == NULL : regular collapsing header
7292// p_visible != NULL && *p_visible == true : show a small close button on the corner of the header, clicking the button will set *p_visible = false

Callers

nothing calls this directly

Calls 4

GetCurrentWindowFunction · 0.85
ImMaxFunction · 0.85
ImVec2Function · 0.85
GetIDMethod · 0.80

Tested by

no test coverage detected