ImGuiWindow: CollapsingHeader Asynchronous
Create a collapsible content group and populate it through a callback. Use it to keep optional settings together without filling the entire window. Add that group’s controls inside the content callback.
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 | Label on the collapsible header. |
contentCallback | (ImGuiWindow) -> () | Receives an ImGuiWindow handle for adding the group’s content. |
Returns
ImGuiWindowThe same ImGuiWindow, allowing another window method to be chained.
Usage notes
The content callback runs through pcall and may yield. Its return value is discarded.
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)