AllenDang / cimgui-go

Auto generated Go wrapper for Dear ImGui via cimgui
MIT License
332 stars 51 forks source link

ImGui::InputText not supported #263

Closed tommysalt closed 7 months ago

tommysalt commented 7 months ago

I discovered that InputText is not supported:

IMGUI_API bool          InputText(const char* label, char* buf, size_t buf_size, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = NULL, void* user_data = NULL);

https://github.com/ocornut/imgui/blob/c6236699671b2e5f94481c051cd19afe00cda583/imgui.h#L601 Example C++ usecase:

ImGui::InputText("password (clear)", password, IM_ARRAYSIZE(password));

Is there a reason for it? It seems to be one of the most important widgets.

gucio321 commented 7 months ago

generally input text is a hard thing to wrap because it involves InputTextCallback which is a callback type. Callback types are a bit tricky in go/C (see #224 )

Currently InputText widget is only available in the form of manually wrapped function InputTextWithHint.

gucio321 commented 7 months ago

spoiler: I'm working on this on a branch in my fork callbacks-2

gucio321 commented 7 months ago

closing as a duplicate of #224