ID stack/scopes
Read the FAQ (docs/FAQ.md or http://dearimgui.com/faq) for more details about how ID are handled in dear imgui.
- Those questions are answered and impacted by understanding of the ID stack system:
- "Q: Why is my widget not reacting when I click on it?"
- "Q: How can I have widgets with an empty label?"
- "Q: How can I have multiple widgets with the same label?"
- Short version: ID are hashes of the entire ID stack. If you are creating widgets in a loop you most likely
want to push a unique identifier (e.g. object pointer, loop index) to uniquely differentiate them.
- You can also use the "Label##foobar" syntax within widget label to distinguish them from each others.
- In this header file we use the "label"/"name" terminology to denote a string that will be displayed + used as an ID,
whereas "str_id" denote a string that is only used as an ID and not normally displayed.
ID stack/scopes Read the FAQ (docs/FAQ.md or http://dearimgui.com/faq) for more details about how ID are handled in dear imgui. - Those questions are answered and impacted by understanding of the ID stack system: - "Q: Why is my widget not reacting when I click on it?" - "Q: How can I have widgets with an empty label?" - "Q: How can I have multiple widgets with the same label?" - Short version: ID are hashes of the entire ID stack. If you are creating widgets in a loop you most likely want to push a unique identifier (e.g. object pointer, loop index) to uniquely differentiate them. - You can also use the "Label##foobar" syntax within widget label to distinguish them from each others. - In this header file we use the "label"/"name" terminology to denote a string that will be displayed + used as an ID, whereas "str_id" denote a string that is only used as an ID and not normally displayed.