Skip to content

Selectable widget: Add an extra argument to set an id different from the label #2330

@jcouet

Description

@jcouet

Version: 1.6.5
Branch: 1.6.5_master

Adding an extra argument to the Selectable widget to set an id different from the label would allow to have several selectable items with the same name.

A possible solution

bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags flags, const ImVec2& size_arg, const char* id_) {
     ...
    ImGuiID id = window->GetID(id_ == 0 ? label : id_);
     ...
}

Your lib is awesome, thank you so much.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions