ImGuiWindow: CollapsingHeader Asynchronous
Group controls beneath a heading that can be collapsed. Add the group’s children in the content callback; collapsing later hides those existing controls.
Luau
ImGuiWindow:CollapsingHeader(
label: string,
contentCallback: (ImGuiWindow) -> ()
) -> ImGuiWindowParameters
Call this method with a ImGuiWindow receiver. The colon supplies self implicitly; a dot call must pass the receiver explicitly.
| Parameter | Type | Description |
|---|---|---|
label | string | Heading shown on the toggle. |
contentCallback | (ImGuiWindow) -> () | Function receiving the same ImGuiWindow handle for adding group content. |
Returns
ImGuiWindowThe same ImGuiWindow handle, so more controls can be added with another method call.
Usage notes
The content callback is called while the group is built, through pcall. Its return value is ignored; expanding the group later does not rerun it.
Example
Luau
local window = imgui.create("Example controls")
window:CollapsingHeader("Appearance", function(group)
group:Text("Preview settings")
group:Checkbox("Show border", true, function(checked)
print("Border:", checked)
end)
end)