mirror of
https://github.com/ocornut/imgui.git
synced 2026-02-07 04:30:08 +00:00
Merge branch 'master' into docking
# Conflicts: # backends/imgui_impl_sdl.cpp # backends/imgui_impl_vulkan.cpp
This commit is contained in:
commit
fc3815bfe5
21 changed files with 35 additions and 96 deletions
|
|
@ -3511,11 +3511,14 @@ static void ShowDemoWindowPopups()
|
|||
// and BeginPopupContextItem() will use the last item ID as the popup ID.
|
||||
{
|
||||
const char* names[5] = { "Label1", "Label2", "Label3", "Label4", "Label5" };
|
||||
static int selected = -1;
|
||||
for (int n = 0; n < 5; n++)
|
||||
{
|
||||
ImGui::Selectable(names[n]);
|
||||
if (ImGui::Selectable(names[n], selected == n))
|
||||
selected = n;
|
||||
if (ImGui::BeginPopupContextItem()) // <-- use last item id as popup id
|
||||
{
|
||||
selected = n;
|
||||
ImGui::Text("This a popup for \"%s\"!", names[n]);
|
||||
if (ImGui::Button("Close"))
|
||||
ImGui::CloseCurrentPopup();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue