mirror of
https://github.com/ocornut/imgui.git
synced 2025-02-20 04:21:01 +01:00
Fixes
parent
80c440f8c1
commit
485cd7b87e
@ -52,8 +52,8 @@ Minimum pseudo-code example using this helper:
|
||||
```cpp
|
||||
static vector<MyItem> items; // Your items
|
||||
static ImGuiSelectionBasicStorage selection; // Your selection
|
||||
selection.AdapterData = (void*)&items; // Setup adapter so selection.ApplyRequests() function can convert indexes to identifiers.
|
||||
selection.AdapterIndexToStorageId = [](ImGuiSelectionBasicStorage* self, int idx) { return ((vector<MyItem>*)self->AdapterData))[idx].ID; };
|
||||
selection.UserData = (void*)&items; // Setup adapter so selection.ApplyRequests() function can convert indexes to identifiers.
|
||||
selection.AdapterIndexToStorageId = [](ImGuiSelectionBasicStorage* self, int idx) { return ((vector<MyItem>*)self->UserData))[idx].ID; };
|
||||
|
||||
ImGuiMultiSelectIO* ms_io = ImGui::BeginMultiSelect(ImGuiMultiSelectFlags_None, selection.Size, items.Size);
|
||||
selection.ApplyRequests(ms_io);
|
||||
|
Loading…
x
Reference in New Issue
Block a user