.. _stdlib_imgui_containers_builtin: =================================================================== Built-in containers — windows, child regions, tabs, menus, popups =================================================================== .. das:module:: imgui_containers_builtin 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. +++++++++++ Call macros +++++++++++ .. _call-macro-imgui_containers_builtin-tooltip: .. das:attribute:: tooltip Function annotation tooltip .. _call-macro-imgui_containers_builtin-group: .. das:attribute:: group Function annotation group .. _call-macro-imgui_containers_builtin-menu: .. das:attribute:: menu Function annotation menu .. _call-macro-imgui_containers_builtin-child: .. das:attribute:: child Function annotation child .. _call-macro-imgui_containers_builtin-popup_modal: .. das:attribute:: popup_modal Function annotation popup_modal .. _call-macro-imgui_containers_builtin-popup: .. das:attribute:: popup Function annotation popup .. _call-macro-imgui_containers_builtin-item_tooltip: .. das:attribute:: item_tooltip Function annotation item_tooltip .. _call-macro-imgui_containers_builtin-collapsing_header: .. das:attribute:: collapsing_header Function annotation collapsing_header .. _call-macro-imgui_containers_builtin-combo_select: .. das:attribute:: combo_select Function annotation combo_select .. _call-macro-imgui_containers_builtin-popup_window: .. das:attribute:: popup_window Function annotation popup_window .. _call-macro-imgui_containers_builtin-menu_bar: .. das:attribute:: menu_bar Function annotation menu_bar .. _call-macro-imgui_containers_builtin-main_menu_bar: .. das:attribute:: main_menu_bar Function annotation main_menu_bar .. _call-macro-imgui_containers_builtin-drag_drop_target: .. das:attribute:: drag_drop_target Function annotation drag_drop_target .. _call-macro-imgui_containers_builtin-edit_tab_item: .. das:attribute:: edit_tab_item Function annotation edit_tab_item .. _call-macro-imgui_containers_builtin-tab_bar: .. das:attribute:: tab_bar Function annotation tab_bar .. _call-macro-imgui_containers_builtin-window: .. das:attribute:: window Function annotation window .. _call-macro-imgui_containers_builtin-popup_context_item: .. das:attribute:: popup_context_item Function annotation popup_context_item .. _call-macro-imgui_containers_builtin-list_box: .. das:attribute:: list_box Function annotation list_box .. _call-macro-imgui_containers_builtin-tab_item: .. das:attribute:: tab_item Function annotation tab_item .. _call-macro-imgui_containers_builtin-wrap_tab_bar: .. das:attribute:: wrap_tab_bar Function annotation wrap_tab_bar .. _call-macro-imgui_containers_builtin-tree_node: .. das:attribute:: tree_node Function annotation tree_node .. _call-macro-imgui_containers_builtin-drag_drop_source: .. das:attribute:: drag_drop_source Function annotation drag_drop_source .. _call-macro-imgui_containers_builtin-popup_context_window: .. das:attribute:: popup_context_window Function annotation popup_context_window +++++++ Windows +++++++ * :ref:`child_scroll_reenter (widget_ident: string; text: string; blk: block\<():void\>) ` * :ref:`is_mouse_pos_valid () : bool ` * :ref:`set_window_size (size: float2; cond: ImGuiCond = imgui::ImGuiCond.None) ` * :ref:`viewport_center (self: ImGuiViewport) : float2 ` .. _function-imgui_containers_builtin_child_scroll_reenter_string_string_block_ls__c_void_gr_: .. das:function:: child_scroll_reenter(widget_ident: string; text: string; blk: block<():void>) Re-enter an existing child (from `child(IDENT, …)`) to nudge scroll via `SetScrollX`/`SetScrollY` in `blk`. MUST replay the original `PushID(IDENT)` so `BeginChild` hashes to the SAME window — without it ImGui makes a phantom sibling and the nudge silently no-ops. No registry entry. :Arguments: * **widget_ident** : string * **text** : string * **blk** : block .. _function-imgui_containers_builtin_is_mouse_pos_valid: .. das:function:: 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). .. _function-imgui_containers_builtin_set_window_size_float2_ImGuiCond: .. das:function:: 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: * **size** : float2 * **cond** : :ref:`ImGuiCond ` .. _function-imgui_containers_builtin_viewport_center_ImGuiViewport: .. das:function:: 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: * **self** : :ref:`ImGuiViewport ` implicit ++++ Tabs ++++ * :ref:`wrap_tab_item (text: string; blk: block\<():void\>) ` .. _function-imgui_containers_builtin_wrap_tab_item_string_block_ls__c_void_gr_: .. das:function:: 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 ++++++ Popups ++++++ * :ref:`close_current_popup () ` * :ref:`close_current_popup (var state: PopupState) ` * :ref:`is_popup_open (state: PopupState) : bool ` * :ref:`open_popup (str_id: string; flags: ImGuiPopupFlags = imgui::ImGuiPopupFlags.None) ` * :ref:`open_popup (var state: PopupState) ` * :ref:`open_popup_on_item_click (str_id: string; flags: ImGuiPopupFlags = imgui::ImGuiPopupFlags.MouseButtonRight) ` * :ref:`open_popup_on_item_click (var state: PopupState; flags: ImGuiPopupFlags = imgui::ImGuiPopupFlags.MouseButtonRight) ` close_current_popup ^^^^^^^^^^^^^^^^^^^ .. _function-imgui_containers_builtin_close_current_popup: .. das:function:: 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). .. _function-imgui_containers_builtin_close_current_popup_PopupState: .. das:function:: close_current_popup(state: PopupState) ---- .. _function-imgui_containers_builtin_is_popup_open_PopupState: .. das:function:: is_popup_open(state: PopupState) : bool True while the paired popup container is open this frame. :Arguments: * **state** : :ref:`PopupState ` open_popup ^^^^^^^^^^ .. _function-imgui_containers_builtin_open_popup_string_ImGuiPopupFlags: .. das:function:: 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: * **str_id** : string * **flags** : :ref:`ImGuiPopupFlags ` .. _function-imgui_containers_builtin_open_popup_PopupState: .. das:function:: open_popup(state: PopupState) ---- open_popup_on_item_click ^^^^^^^^^^^^^^^^^^^^^^^^ .. _function-imgui_containers_builtin_open_popup_on_item_click_string_ImGuiPopupFlags: .. das:function:: 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: * **str_id** : string * **flags** : :ref:`ImGuiPopupFlags ` .. _function-imgui_containers_builtin_open_popup_on_item_click_PopupState_ImGuiPopupFlags: .. das:function:: open_popup_on_item_click(state: PopupState; flags: ImGuiPopupFlags = imgui::ImGuiPopupFlags.MouseButtonRight)