Yes, that would work. But that would be a departure from existing imgui paradigm where the output of imgui library is a 2d bitmap. At that point, it gets really close to the vDOM territory ...
As for the stable identities, yes, it is important. But I also don't see much of a problem with explicit Key: the UI components ultimately will have map back into a data object, which should have enough contextual information to provide the said Key.
Re:Towards Principled Reactive UI
by mwcampbell on Saturday September 26, 2020 @05:27PM
(#24602286)
You're right; for accessibility, at least for screen readers, you need something a lot like a DOM (whether real or virtual).
Re:Towards Principled Reactive UI
by stephc_int13 on Saturday September 26, 2020 @08:28PM
(#24603255)
The output of most imgui libraries is not a 2D bitmap but a structure containing vertices, indices and texture handles, that can be used to render.
IMO, the bigger problem is the one that Raph pointed out: widgets (including simple ones like static text) need to have stable identities throughout their lifetimes, even as their state, contents, and locations change. It seems to me that IMGUIs, or at least some of them, make this particularly difficult.