mirror of
https://github.com/ocornut/imgui.git
synced 2024-11-28 09:30:56 +01:00
Simplified example
This commit is contained in:
parent
91f8eb7b92
commit
de7552047b
17
imgui.cpp
17
imgui.cpp
@ -9437,18 +9437,15 @@ void ImGui::ShowTestWindow(bool* opened)
|
||||
popup_open = true;
|
||||
ImGui::SameLine();
|
||||
ImGui::Text(selected_fish == -1 ? "<None>" : fishes[selected_fish]);
|
||||
|
||||
if (popup_open)
|
||||
{
|
||||
if (ImGui::BeginPopup(&popup_open))
|
||||
{
|
||||
for (size_t i = 0; i < IM_ARRAYSIZE(fishes); i++)
|
||||
if (ImGui::Selectable(fishes[i], false))
|
||||
{
|
||||
selected_fish = i;
|
||||
popup_open = false;
|
||||
}
|
||||
}
|
||||
ImGui::BeginPopup(&popup_open);
|
||||
for (size_t i = 0; i < IM_ARRAYSIZE(fishes); i++)
|
||||
if (ImGui::Selectable(fishes[i], false))
|
||||
{
|
||||
selected_fish = i;
|
||||
popup_open = false;
|
||||
}
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
ImGui::TreePop();
|
||||
|
Loading…
Reference in New Issue
Block a user