Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jcouet opened this issue Feb 2, 2019 · 2 comments
Closed
Labels
label/id and id stack implicit identifiers, pushid(), id stack

Comments

@jcouet
Copy link

jcouet commented Feb 2, 2019

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.

@ocornut
Copy link
Owner

ocornut commented Feb 2, 2019 via email

@jcouet
Copy link
Author

jcouet commented Feb 2, 2019

Found it, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
label/id and id stack implicit identifiers, pushid(), id stack
Projects
None yet
Development

No branches or pull requests

2 participants