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
When using ofSystemTextBoxDialog with a pre-populated input field, there is no way to know that the "Cancel" option has been chosen if the pre-populated value is a valid answer.
Typical use is something like:
string userInputText = ofSystemTextBoxDialog("Question?", "Pre-populated valid answer, not identifiable placeholder");
//check userInputText value
The issue is that in this simple case, userInputText will hold the pre-populated answer even if Cancel is selected (by implementation in ofSystemUtils.cpp).
I wonder if that could be addressed, maybe by returning an empty string?
E.g. (OSX):
The empty string approach seems like a good way.
It should probably only be the repopulated text if the person hits the okay button.
We could also switch the return type to a custom type which contains the string and also the button that was hit, but this might be an overly complex way to handle it.
ShadowMitia
added a commit
to ShadowMitia/openFrameworks
that referenced
this issue
Oct 18, 2018
When using ofSystemTextBoxDialog with a pre-populated input field, there is no way to know that the "Cancel" option has been chosen if the pre-populated value is a valid answer.
Typical use is something like:
The issue is that in this simple case,
userInputText
will hold the pre-populated answer even if Cancel is selected (by implementation in ofSystemUtils.cpp).I wonder if that could be addressed, maybe by returning an empty string?
E.g. (OSX):
Or maybe there's another way to handle these (admittedly edge) cases?
The text was updated successfully, but these errors were encountered: