mirror of
https://github.com/ocornut/imgui.git
synced 2025-09-29 22:58:31 +00:00
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:
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user