API reference
Preparing search index…

ImGui.BeginListBox

  • Begin a framed, scrollable list-box region.

    Parameters

    label
    string | Uint8Array

    Widget label; interactive widgets also use it for ID generation. A ## suffix can distinguish IDs without displaying the suffix.

    size

    List-box frame dimensions in pixels; zero width uses the current item width and zero height fits about seven items. Negative axes align to the remaining region.

    Returns

    boolean

    True when this scope is open/active and its contents may be submitted. Call EndListBox() only when true; on false, skip both contents and the matching end.

    • This is essentially a thin wrapper to using BeginChild/EndChild with the ImGuiChildFlags.FrameStyle flag for stylistic changes + displaying a label.

    • If you don't need a label you can probably simply use BeginChild() with the ImGuiChildFlags.FrameStyle flag for the same result.

    • You can submit contents and manage your selection state however you want it, by creating e.g. Selectable() or any other items.

    • The simplified/old ListBox() api are helpers over BeginListBox()/EndListBox() which are kept available for convenience purpose. This is analoguous to how Combos are created.

    • Choose frame width: size.x > 0.0: custom / size.x < 0.0 or -FLT_MIN: right-align / size.x = 0.0 (default): use current ItemWidth

    • Choose frame height: size.y > 0.0: custom / size.y < 0.0 or -FLT_MIN: bottom-align / size.y = 0.0 (default): arbitrary default height which can fit ~7 items

    open a framed scrolling region

    Source & inheritance

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