2.2. Built-in containers — windows, child regions, tabs, menus, popups

Built-in containers — block-arg wrappers around ImGui’s Begin/End family. Annotated with [container] so the body is wrapped with container_path_push(widget_ident) / container_path_pop() automatically, giving leaf widgets nested registry keys (e.g. MAIN_WIN/SETTINGS_TAB/RPS). Covers windows (window, child, group), tab bars + items (tab_bar, tab_item), trees (tree_node, collapsing_header), menus (menu_bar, menu, menu_item), and popups (popup, modal, tooltip).

The Begin/End pairing rules differ per kind — Begin/End and BeginChild/EndChild always pair; everything else is End-only-on-true — so each container def authors its own pairing inline rather than the macro guessing.

2.2.1. Call macros

tooltip

Function annotation tooltip

group

Function annotation group

menu

Function annotation menu

child

Function annotation child

popup_modal

Function annotation popup_modal

popup

Function annotation popup

item_tooltip

Function annotation item_tooltip

collapsing_header

Function annotation collapsing_header

combo_select

Function annotation combo_select

popup_window

Function annotation popup_window

menu_bar

Function annotation menu_bar

main_menu_bar

Function annotation main_menu_bar

drag_drop_target

Function annotation drag_drop_target

edit_tab_item

Function annotation edit_tab_item

tab_bar

Function annotation tab_bar

window

Function annotation window

popup_context_item

Function annotation popup_context_item

list_box

Function annotation list_box

tab_item

Function annotation tab_item

wrap_tab_bar

Function annotation wrap_tab_bar

tree_node

Function annotation tree_node

drag_drop_source

Function annotation drag_drop_source

popup_context_window

Function annotation popup_context_window

2.2.2. Windows

child_scroll_reenter(widget_ident: string; text: string; blk: block<():void> )

Re-enter an existing child window (created earlier this frame by child(IDENT, (text = …))) to nudge its scroll position via SetScrollX / SetScrollY inside blk. Replicates the original container’s PushID(IDENT) frame (emitted by widget_prelude) so BeginChild(text, …) hashes to the SAME window — without it ImGui creates a phantom sibling and the scroll nudge silently has no visible effect. widget_ident MUST be the literal IDENT string the original child was called with — typo = silent miss. No registry entry; this is a scroll-nudge, not a container.

Arguments:
  • widget_ident : string

  • text : string

  • blk : block<void>

is_mouse_pos_valid(): bool

IsMousePosValid(NULL) — true when ImGui has a sensible mouse position (false on platforms / first frame where the mouse hasn’t been observed).

set_window_size(size: float2; cond: ImGuiCond = imgui::ImGuiCond.None )

SetWindowSize(size, cond) — resize the current/last window. Pair with SetNextWindowSizeConstraints to clamp into a fixed range.

Arguments:
viewport_center(self: ImGuiViewport ): float2

viewport.GetCenter() — viewport’s center-screen position. Pair with SetNextWindowPos(center, ImGuiCond.Always, float2(0.5,0.5)) to center the next window on the viewport.

Arguments:

2.2.3. Tabs

wrap_tab_item(text: string; blk: block<():void> )

One tab of a wrap_tab_bar. Its body block renders only while this tab is the active one. Tabs are indexed in declaration order — keep the order stable across frames (the header strip is laid out a frame behind).

Arguments:
  • text : string

  • blk : block<void>

2.2.4. Popups

2.2.4.1. close_current_popup

close_current_popup()

No-state form for body-internal use where a PopupState ident isn’t in scope (e.g., inside popup_context_item, which is stateless).

close_current_popup(state: PopupState )

is_popup_open(state: PopupState ): bool

True while the paired popup container is open this frame.

Arguments:

2.2.4.2. open_popup

open_popup(str_id: string; flags: ImGuiPopupFlags = imgui::ImGuiPopupFlags.None )

String-id form for stateless popups (paired with popup_context_item). No telemetry — open-state lives in ImGui internals.

Arguments:
open_popup(state: PopupState )

2.2.4.3. open_popup_on_item_click

open_popup_on_item_click(str_id: string; flags: ImGuiPopupFlags = imgui::ImGuiPopupFlags.MouseButtonRight )

Right-click on the previously-submitted item opens str_id popup. Stateless trigger paired with popup_context_item.

Arguments:
open_popup_on_item_click(state: PopupState; flags: ImGuiPopupFlags = imgui::ImGuiPopupFlags.MouseButtonRight )