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

ImGui::Selectable works only for first item #1556

Closed
kklimek opened this issue Jan 18, 2018 · 2 comments
Closed

ImGui::Selectable works only for first item #1556

kklimek opened this issue Jan 18, 2018 · 2 comments
Labels
label/id and id stack implicit identifiers, pushid(), id stack

Comments

@kklimek
Copy link

kklimek commented Jan 18, 2018

https://bitbucket.org/kamilklimek/tracy/src/30cc523634c3b8944e69ad5aa48194488d4ac4c6/server/TracyView.cpp?at=selectable-does-not-work&fileviewer=file-view-default#TracyView.cpp-4208

Could you please ivestigate code above. For some reason ImGui::Selectable returns true only for first item in each created TreeNode but ImGui::ItemIsClicked works always. I wasn't able to reproduce it on any minimal code sample or even on imgui demo, thats why I point out whole project, however I hope you will be able to run it.

How to reproduce
Compile and run 'standalone/build/win32/Tracy.sln'
Compile test

In application launched click "Connect"
Run tracy_test
Some data should start showing, click "Find Zone" button
In "Find Zone" window type "Test" and click "Find"
Expand TreeNode, click on first "Test function" and see that if( ImGui::Selectable hits
Click on second "Test function" and see that if( ImGui::Selectable does not hit
Do the same for if( ImGui::IsItemClicked() )

@ocornut
Copy link
Owner

ocornut commented Jan 18, 2018

What's the ID of all your selectables? Have you read the FAQ? Do you understand how the ID Stack works?

@ocornut
Copy link
Owner

ocornut commented Jan 18, 2018

You can always reproduce a minimal code example by calling the same functions with the same parameters. You would have found out that your parameters are probably the reason.
You can use PushID()/PopID() to alter the ID Stack, but please 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