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
I am new to GitHub and am not yet sure how to upload a suggested code change. Thus I've just provided it as an issue:
I fixed this for my purposes but it is a breakings change. On the other hand it now seems to match your overall system for handling window closing.
Clicking close window 'X' on DrawWindow() doesn't close the window.
Fix as follows:
Add bool* p_open to parameter list of DrawOpen on line 188 as follows:
Line 188 void DrawWindow(bool* p_open, const char* title, void* mem_data, size_t mem_size, size_t base_display_addr = 0x0000)
Change Lines 195 as follows: (replace &Open with p_open)
if (ImGui::Begin(title, &Open, ImGuiWindowFlags_NoScrollbar))
if (ImGui::Begin(title, p_open, ImGuiWindowFlags_NoScrollbar))
You could remove boolean Open from the remainder of the file.
Brad
The text was updated successfully, but these errors were encountered:
The way it was initially designed it that you can read and write to that bool Open flag in the structure, but you are correct this is quite non-idiomatic with how we do most things in imgui land (generally speaking memory editor is old code at this point).
ocornut
changed the title
Clicking on the Close 'X' in DrawWindow() doesn't close the window
Making p_open a parameter instead of a member?
May 28, 2024
I am new to GitHub and am not yet sure how to upload a suggested code change. Thus I've just provided it as an issue:
I fixed this for my purposes but it is a breakings change. On the other hand it now seems to match your overall system for handling window closing.
Clicking close window 'X' on DrawWindow() doesn't close the window.
Fix as follows:
Add bool* p_open to parameter list of DrawOpen on line 188 as follows:
Line 188 void DrawWindow(bool* p_open, const char* title, void* mem_data, size_t mem_size, size_t base_display_addr = 0x0000)
Change Lines 195 as follows: (replace &Open with p_open)
if (ImGui::Begin(title, &Open, ImGuiWindowFlags_NoScrollbar))
if (ImGui::Begin(title, p_open, ImGuiWindowFlags_NoScrollbar))
You could remove boolean Open from the remainder of the file.
Brad
The text was updated successfully, but these errors were encountered: