ImStrv: convert Combo()/ListBox() to use ImStrv in their getters.

Didn't convert Combo() "const char* items_separated_by_zeros" as this doesn't translate well when used via a ImStrv constructor, may actually aim to obsolete.
Fixed for shadowing local variable warning on 2025/06/25.
This commit is contained in:
ocornut
2024-04-03 09:58:36 +09:00
committed by ocornut
parent 6d452bf0fe
commit 86af6db63b
3 changed files with 69 additions and 23 deletions

View File

@@ -1369,7 +1369,7 @@ static void DemoWindowWidgetsComboBoxes()
// Simplified one-liner Combo() using an accessor function
static int item_current_4 = 0;
ImGui::Combo("combo 5 (function)", &item_current_4, [](void* data, int n) { return ((const char**)data)[n]; }, items, IM_ARRAYSIZE(items));
ImGui::Combo("combo 5 (function)", &item_current_4, [](void* data, int n) { return ImStrv(((const char**)data)[n]); }, items, IM_ARRAYSIZE(items));
ImGui::TreePop();
}