Getter for the old Combo() API: "item1\0item2\0item3\0"
| 2144 | |
| 2145 | // Getter for the old Combo() API: "item1\0item2\0item3\0" |
| 2146 | static 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. |
| 2162 | bool 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) |
nothing calls this directly
no outgoing calls
no test coverage detected