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

combobox in the TabItem has an error #6364

Closed
ashe27 opened this issue Apr 24, 2023 · 2 comments
Closed

combobox in the TabItem has an error #6364

ashe27 opened this issue Apr 24, 2023 · 2 comments
Labels
label/id and id stack implicit identifiers, pushid(), id stack

Comments

@ashe27
Copy link

ashe27 commented Apr 24, 2023

The first parameter of BeginCombo cannot be left blank, otherwise it will not pop up correctly under the TabItem. I'm not sure if this is a bug.

if (ImGui::BeginTabItem("Test"))
{
    if (ImGui::BeginCombo("", "None"))
    {
        ImGui::EndCombo();
    }
    ImGui::EndTabItem();
}
@cfillion
Copy link
Contributor

It needs a non-empty label to compute the combo box's unique ID. The label can be hidden by prepending ## to it: ImGui::BeginCombo("##my_combo", ...).

https://github.com/ocornut/imgui/blob/master/docs/FAQ.md#q-about-the-id-stack-system

@ashe27
Copy link
Author

ashe27 commented Apr 24, 2023

It needs a non-empty label to compute the combo box's unique ID. The label can be hidden by prepending ## to it: ImGui::BeginCombo("##my_combo", ...).

https://github.com/ocornut/imgui/blob/master/docs/FAQ.md#q-about-the-id-stack-system

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

3 participants