mirror of
https://github.com/ocornut/imgui.git
synced 2025-04-07 22:43:09 +00:00
Simplified example
This commit is contained in:
parent
91f8eb7b92
commit
de7552047b
1 changed files with 7 additions and 10 deletions
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…
Add table
Reference in a new issue