Popup modal doesn't work
AllenDang opened this issue · 1 comments
AllenDang commented
Popup doesn't show after I click the button.
if imgui.Button("Click Me") {
imgui.OpenPopup("Confirm")
if imgui.BeginPopupModalV("Confirm", nil, imgui.WindowFlagsAlwaysAutoResize) {
imgui.Text("Confirm to quit?")
imgui.Separator()
if imgui.Button("Yes") {
imgui.CloseCurrentPopup()
}
imgui.SameLine()
if imgui.Button("No") {
imgui.CloseCurrentPopup()
}
imgui.EndPopup()
}
}
AllenDang commented
I see, it's not an issue, because I put the BeginPopupModal in the wrong place. I should move it out of the button click section and everything works fine.