You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes I need to input some value that requires additional verification before storing it in the target variable (best example would be path to file - not every string is a path to an existing file - but example below checks if the string is lowercase as it is more portable than filepath) and I would prefer to do this verification only when user actually performs some change. However, contrary to my expectations(*), InputText() returns true when its internal buffer is different from buf argument which leads to checks being perfomed every frame instead of only when user actually changes the value.
I'm not sure if this behaviour is a bug or is it intended.
(*) Expectations based on:
Most widgets return true when the value has been changed or when pressed/selected (imgui.h:489)
InputTextEx() comment When active, hold on a privately held copy of the text (and apply back to 'buf'). So changing 'buf' while the InputText is active has no effect. (imgui_widgets.cpp:3865)
Standalone, minimal, complete and verifiable example:
Version/Branch of Dear ImGui:
Version: 1.83
Branch: docking
My Issue/Question:
Sometimes I need to input some value that requires additional verification before storing it in the target variable (best example would be path to file - not every string is a path to an existing file - but example below checks if the string is lowercase as it is more portable than filepath) and I would prefer to do this verification only when user actually performs some change. However, contrary to my expectations(*), InputText() returns true when its internal buffer is different from
buf
argument which leads to checks being perfomed every frame instead of only when user actually changes the value.I'm not sure if this behaviour is a bug or is it intended.
(*) Expectations based on:
Most widgets return true when the value has been changed or when pressed/selected
(imgui.h:489)When active, hold on a privately held copy of the text (and apply back to 'buf'). So changing 'buf' while the InputText is active has no effect.
(imgui_widgets.cpp:3865)Standalone, minimal, complete and verifiable example:
The text was updated successfully, but these errors were encountered: