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

Listbox is repeating #5210

Closed
MaloCow opened this issue Apr 18, 2022 · 1 comment
Closed

Listbox is repeating #5210

MaloCow opened this issue Apr 18, 2022 · 1 comment
Labels
label/id and id stack implicit identifiers, pushid(), id stack

Comments

@MaloCow
Copy link

MaloCow commented Apr 18, 2022

Hello, i just made a listbox that grab FiveM resources list of a server, so this is my code :

static const char* resources[] =
{
resource->GetName().c_str()
};

static int selectedResource = 0;

ImGui::ListBox("", &selectedResource, resources, IM_ARRAYSIZE(resources));

When the main resource of FiveM show it's working perfectly, so in my ListBox i have only wrote "cfx_internal"
but when all server resources is showing, the ListBox is repeating everytime that a resource is showing
Like at the end of the load of the server, i got probably 200 listbox in 1 window, and i want to show resources in only 1 listbox.
What should i do?

@ocornut
Copy link
Owner

ocornut commented Apr 18, 2022

Your widgets should have unique identifiers otherwise same identifier will append. You are using “”. Read the FAQ.

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