Closed algotron closed 4 months ago
Please provide me with a complete minimum reproducible example that I can compile on my side. Also, please enclose the code blocks with ``` see markdown guide here: https://www.markdownguide.org/extended-syntax/#fenced-code-blocks
Okay, let me provide some hints. Please learn a bit about Markdown. This will help you format your questions. It seems like you're trying to do it anyway (which is a good thing !), but knowing markdown will help a lot: see https://www.markdownguide.org/basic-syntax/
Then, you should learn about how to provide minimal reproducible examples when asking questions: look at https://stackoverflow.com/help/minimal-reproducible-example In short:
As far as the answer is concerned, look at the 4th line of the doc for ShowMenus here: https://pthom.github.io/hello_imgui/book/doc_params.html#runnercallbacks , which I reproduced below.
// `ShowMenus`: Fill it with a function that will add ImGui menus by calling:
// ImGui::BeginMenu(...) / ImGui::MenuItem(...) / ImGui::EndMenu()
// Notes:
// * you do not need to call ImGui::BeginMenuBar and ImGui::EndMenuBar
// * Some default menus can be provided:
// see ImGuiWindowParams options:
// _showMenuBar, showMenu_App_QuitAbout, showMenu_View_
VoidFunction ShowMenus = EmptyVoidFunction();
Hello Pascal,
I apologize for not responding earlier to your email following up on my post. I was trying to link against .a files in the ImGui Bundle demo build, but it was not at all obvious how to do this . I think the probable pointer issue may have stemmed from that.
I since dowloaded the dear imgui demo project and am linking against the archive files in that build. Unfortunately, I have not had a chance to test the errant pointer yet as the rebuild is still in progress.
Thank-you for the very helpful email that you sent.
Yours truly,
Peter Walker
On Jul 22, 2024, at 4:21 PM, Pascal Thomet @.***> wrote:
Closed #118 https://github.com/pthom/hello_imgui/issues/118 as completed.
— Reply to this email directly, view it on GitHub https://github.com/pthom/hello_imgui/issues/118#event-13606449484, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4IQUUIEESI2STUJJFCXQHLZNVSUTAVCNFSM6AAAAABKZQY4UCVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJTGYYDMNBUHE2DQNA. You are receiving this because you authored the thread.
Custom Menu: Menu accesses a NULL window pointer —————————————————————————
From the ImGui Bundle, I inserted the following lines to make a custom menu: —————————————————————————————————
I then added the following: ———————————————————————————
CAppState is:
Result: ——————
When the example code is run without the custom menu inserted, it works fine and the window is defined
In the custom menu is defined, the ASSERT at line 7304 in imgui_widgets.cpp on the Line IM_ASSERT(!window->DC.MenuBarAppending);
Here is the code:
CASE 1: ————— using the modifications above, the assert is caused by
IM_ASSERT(!window->DC.MenuBarAppending); where window->DC.MenuBarAppending == true
CASE 2 ———— where the same modifications were made (in a more complex app), the pointer to the window is NULL
What am I missing?