API reference
Preparing search index…

ImGui.PushID

  • Push a string identifier onto the ID stack.

    Parameters

    str_id
    string | Uint8Array

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

    Returns

    void

    Read the FAQ (docs/FAQ.md or http://dearimgui.com/faq) for more details about how ID are handled in dear imgui.

    • Those questions are answered and impacted by understanding of the ID stack system:

    • "Q: Why is my widget not reacting when I click on it?"

    • "Q: How can I have widgets with an empty label?"

    • "Q: How can I have multiple widgets with the same label?"

    • Short version: ID are hashes of the entire ID stack. If you are creating widgets in a loop you most likely want to push a unique identifier (e.g. object pointer, loop index) to uniquely differentiate them.

    • You can also use the "Label##foobar" syntax within widget label to distinguish them from each others.

    • In this header file we use the "label"/"name" terminology to denote a string that will be displayed + used as an ID, whereas "str_id" denote a string that is only used as an ID and not normally displayed.

    push string into the ID stack (will hash string).

    Source & inheritance

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