Re:Dear ImGui – Bloat-free graphical user interface library ...
by flohofwoe on Wednesday November 04, 2020 @07:37AM
(#24988447)
Dear ImGui already uses such "implicit" widget ids, by default it hashes the widget's label string, window title or name, with a convention to add an invisible 'identifier string' to the label string separated by a "##" (e.g. "Label##id") - for the case that the visible label string needs to change or isn't unique within the current scope. There are also separate PushID/PopID functions to manage such widget ids in "more elaborate ways".
[ Parent
| on HN ]
Re:Dear ImGui – Bloat-free graphical user interface library ...
by malkia on Wednesday November 04, 2020 @03:56PM
(#24992971)
This also has been one of my biggest gripes with "imgui" style of libraries - as the end of the day something needs to keep state somewhere, and implementations/hack can be very language/runtime oriented to avoid hacks like above, or use the hack above.
It also caught me by surprise, and would catch many others where seemingly normal controls, that just happen to have the same text would be identified with the same state, as the text (contents) are initially used to point to this state.
Re:Dear ImGui – Bloat-free graphical user interface library ...
by ratww on Wednesday November 04, 2020 @07:45AM
(#24988487)
Interesting, I didn't knew that. I helped write a couple immediate-mode GUI some time ago, but I'm not deeply familiar with ImGui.
If this is the case, then it seems entirely possible to have an "internal retained mode", and might even help with some extra stuff like focus management and accessibility.