From 8d53f834ee1a5ae965fa8562e44039db59aeb199 Mon Sep 17 00:00:00 2001 From: omar Date: Thu, 18 Apr 2019 18:24:51 +0200 Subject: [PATCH] Demo: Documents: Fix misusage of ListBoxHeader(). --- imgui_demo.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/imgui_demo.cpp b/imgui_demo.cpp index 443c3c23..6dd69bd3 100644 --- a/imgui_demo.cpp +++ b/imgui_demo.cpp @@ -4402,11 +4402,13 @@ void ShowExampleAppDocuments(bool* p_open) { ImGui::Text("Save change to the following items?"); ImGui::PushItemWidth(-1.0f); - ImGui::ListBoxHeader("##", close_queue_unsaved_documents, 6); - for (int n = 0; n < close_queue.Size; n++) - if (close_queue[n]->Dirty) - ImGui::Text("%s", close_queue[n]->Name); - ImGui::ListBoxFooter(); + if (ImGui::ListBoxHeader("##", close_queue_unsaved_documents, 6)) + { + for (int n = 0; n < close_queue.Size; n++) + if (close_queue[n]->Dirty) + ImGui::Text("%s", close_queue[n]->Name); + ImGui::ListBoxFooter(); + } if (ImGui::Button("Yes", ImVec2(80, 0))) {