You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The comment for BeginPopupModal, added in commit #f1c75964, mentions that:
popup visibility status is owned by Dear ImGui (and manipulated with e.g. OpenPopup) so the actual value of *p_open is meaningless here.
However, when p_open is set to false when passed to the function, this condition evaluates to false, which returns false and hides the popup. Tracing back through the git history, this if block dates back to #8c790a32 when p_open was first added.
The code clearly indicates that if p_open is false, the popup will not be displayed, contradicting the comment. Could you clarify the intended behavior?
Standalone, minimal, complete and verifiable example:
ImGui::Begin("window");
if (ImGui::Button("open"))
ImGui::OpenPopup("popup window");
bool p_open = false;
if (ImGui::BeginPopupModal("popup window", &p_open))
{
ImGui::EndPopup();
}
ImGui::End();
The text was updated successfully, but these errors were encountered:
I think we should preserve the current behavior and amend the comment.
Note however it is inconsistent with Begin() with currently DOES ignore the value of *p_open (I don't recall the reason presently, in believe in theory Begin() could assert to prevent misuse). Either way the current popup behavior is the desirable behavior.
Version/Branch of Dear ImGui:
Version: 1.89.9 WIP
Branch: master
My Issue/Question:
The comment for
BeginPopupModal
, added in commit#f1c75964
, mentions that:However, when
p_open
is set to false when passed to the function, this condition evaluates to false, which returns false and hides the popup. Tracing back through the git history, this if block dates back to#8c790a32
whenp_open
was first added.The code clearly indicates that if
p_open
is false, the popup will not be displayed, contradicting the comment. Could you clarify the intended behavior?Standalone, minimal, complete and verifiable example:
The text was updated successfully, but these errors were encountered: