ocornut / imgui_club

Nice things to use along dear imgui
MIT License
927 stars 108 forks source link

Allow to still select (and preview data) when ReadOnly is set #46

Closed DeltaGW2 closed 3 months ago

DeltaGW2 commented 3 months ago

If ReadOnly is enabled you can no longer select any data and therefore not preview it.

This PR fixes that issue by

ocornut commented 3 months ago

Thanks for the PR. Merged as 3bd1c1b !

silverweed commented 2 months ago

Hello, after this change I tried setting the ReadOnly flag to true but when I click on a byte imgui crashes with:

imgui_widgets.cpp:4882: bool ImGui::InputTextEx(const char *, const char *, char *, int, const ImVec2 &, ImGuiInputTextFlags, ImGuiInputTextCallback, void *): Assertion `!is_readonly' failed.

This happens whether or not I set WriteFn.

Reproducer: just add the ReadOnly flag at this line, launch the executable with ./rntviewer lmext1.root and click on a byte.

ocornut commented 2 months ago

Thank you @silverweed . I have investigated this and established that the assert is in fault, Pushed https://github.com/ocornut/imgui/commit/8a946b69e98d819e9123963122d3b8b10df52e78 to main repository.

ocornut commented 2 months ago

I have also pushed a workaround in the imgui_memory_editor itself for good measure: 49a5ee0

silverweed commented 2 months ago

Thank you!