mirror of
https://github.com/ocornut/imgui.git
synced 2024-11-27 16:29:02 +08:00
InputText: adding clarifying note about ImGuiInputTextCallbackData::Buf. (#7363)
This commit is contained in:
parent
fbf45ad149
commit
6b7358e9f3
2
imgui.h
2
imgui.h
@ -2268,6 +2268,8 @@ struct ImGuiInputTextCallbackData
|
||||
void* UserData; // What user passed to InputText() // Read-only
|
||||
|
||||
// Arguments for the different callback events
|
||||
// - During Resize callback, Buf will be same as your input buffer.
|
||||
// - However, during Completion/History/Always callback, Buf always points to our own internal data (it is not the same as your buffer)! Changes to it will be reflected into your own buffer shortly after the callback.
|
||||
// - To modify the text buffer in a callback, prefer using the InsertChars() / DeleteChars() function. InsertChars() will take care of calling the resize callback if necessary.
|
||||
// - If you know your edits are not going to resize the underlying buffer allocation, you may modify the contents of 'Buf[]' directly. You need to update 'BufTextLen' accordingly (0 <= BufTextLen < BufSize) and set 'BufDirty'' to true so InputText can update its internal state.
|
||||
ImWchar EventChar; // Character input // Read-write // [CharFilter] Replace character with another one, or set to zero to drop. return 1 is equivalent to setting EventChar=0;
|
||||
|
Loading…
Reference in New Issue
Block a user