From 446d8abfb07f8fae596d5ba322a5787b2f57fcb8 Mon Sep 17 00:00:00 2001 From: ocornut Date: Sun, 31 May 2015 11:54:00 +0100 Subject: [PATCH] ListBoxHeader() can return false. Also made ListBox() only use public API. --- imgui.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index a3cf1697..49c56aea 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -7465,6 +7465,8 @@ bool ImGui::Selectable(const char* label, bool* p_selected, const ImVec2& size_a bool ImGui::ListBoxHeader(const char* label, const ImVec2& size_arg) { ImGuiWindow* window = GetCurrentWindow(); + if (window->SkipItems) + return false; const ImGuiStyle& style = ImGui::GetStyle(); const ImGuiID id = ImGui::GetID(label); @@ -7527,10 +7529,6 @@ bool ImGui::ListBox(const char* label, int* current_item, const char** items, in bool ImGui::ListBox(const char* label, int* current_item, bool (*items_getter)(void*, int, const char**), void* data, int items_count, int height_in_items) { - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return false; - if (!ImGui::ListBoxHeader(label, items_count, height_in_items)) return false;