BeginChild (String ID)
Creates a child window with a string identifier.Parameters
const char*
required
Unique identifier for the child window within the parent.
const ImVec2&
default:"ImVec2(0, 0)"
Child window size. Per axis:
0.0f = use remaining parent size, >0.0f = specified size, <0.0f = use remaining minus specified value.ImGuiChildFlags
default:"0"
Child-specific flags (borders, auto-resize, etc.). Before v1.90, this was a
bool border parameter.ImGuiWindowFlags
default:"0"
Standard window flags (scrollbars, input handling, etc.).
Returns
bool
Returns false if the child window is collapsed or fully clipped. You must still call
EndChild() regardless.Description
Child windows:- Create independent scrolling/clipping regions
- Can contain any widgets including other child windows
- Inherit parent window’s font and style
- Can have borders, auto-resize, and custom backgrounds
Example
BeginChild (ImGuiID)
Creates a child window with a numeric identifier.Parameters
ImGuiID
required
Unique numeric identifier for the child window. Useful when generating children in loops.
const ImVec2&
default:"ImVec2(0, 0)"
Child window size.
ImGuiChildFlags
default:"0"
Child-specific flags.
ImGuiWindowFlags
default:"0"
Standard window flags.
Example
EndChild
Ends the current child window.Description
Must be called for everyBeginChild(), regardless of return value.
Example
Child Window Sizing
Manual Sizing
Auto-Resize
Combining
ImGuiChildFlags_AutoResizeX and ImGuiChildFlags_AutoResizeY defeats the purpose of a scrolling region and is not recommended. The child will grow infinitely with content.