2
0
Эх сурвалжийг харах

Demo: Documents: Fix misusage of ListBoxHeader().

omar 6 жил өмнө
parent
commit
8d53f834ee
1 өөрчлөгдсөн 7 нэмэгдсэн , 5 устгасан
  1. 7 5
      imgui_demo.cpp

+ 7 - 5
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)))
                 {