MCPcopy Create free account
hub / github.com/Wemino/EchoPatch / Items_SingleStringGetter

Function Items_SingleStringGetter

include/imgui/imgui_widgets.cpp:2146–2159  ·  view source on GitHub ↗

Getter for the old Combo() API: "item1\0item2\0item3\0"

Source from the content-addressed store, hash-verified

2144
2145// Getter for the old Combo() API: "item1\0item2\0item3\0"
2146static const char* Items_SingleStringGetter(void* data, int idx)
2147{
2148 const char* items_separated_by_zeros = (const char*)data;
2149 int items_count = 0;
2150 const char* p = items_separated_by_zeros;
2151 while (*p)
2152 {
2153 if (idx == items_count)
2154 break;
2155 p += ImStrlen(p) + 1;
2156 items_count++;
2157 }
2158 return *p ? p : NULL;
2159}
2160
2161// Old API, prefer using BeginCombo() nowadays if you can.
2162bool ImGui::Combo(const char* label, int* current_item, const char* (*getter)(void* user_data, int idx), void* user_data, int items_count, int popup_max_height_in_items)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected