API reference
Preparing search index…

ImGui.OpenPopup

  • Mark a popup as open.

    Parameters

    str_id
    string | Uint8Array

    String identifier hashed with the current ID stack to distinguish this item or scope.

    popup_flags
    number = 0

    ImGuiPopupFlags options controlling this operation; combine compatible flag bits with |.

    Returns

    void
    • OpenPopup(): set popup state to open. ImGuiPopupFlags are available for opening options.

    • If not modal: they can be closed by clicking anywhere outside them, or by pressing ESCAPE.

    • CloseCurrentPopup(): use inside the BeginPopup()/EndPopup() scope to close manually.

    • CloseCurrentPopup() is called by default by Selectable()/MenuItem() when activated (FIXME: need some options).

    • Use ImGuiPopupFlags.NoOpenOverExistingPopup to avoid opening a popup if there's already one at the same level. This is equivalent to e.g. testing for !IsPopupOpen("", ImGuiPopupFlags.AnyPopupId) prior to OpenPopup().

    • Use IsWindowAppearing() after BeginPopup() to tell if a window just opened.

    • IMPORTANT: Notice that for OpenPopupOnItemClick() we exceptionally default flags to 1 (== ImGuiPopupFlags.MouseButtonRight) for backward compatibility with older API taking 'int mouse_button = 1' parameter

    call to mark popup as open (don't call every frame!).

    Source & inheritance

Icons made by Lorc, Delapouite & Skoll · game-icons.net · CC BY 3.0