ImNodes::BeginNodeEditor(); // Or ImNodes::BeginNode(hardcoded_node_id);
// Below ImGui's demo code
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();
ImGui::EndPopup();
}
I'm trying to bring in a context menu for convenient nodes creation
I think i had the same issue and solved it by moving the popup handling outside of the NodeEditor's Begin/End block. In node editor i only remember which node the popup would be related to.
Popup doesn't show up with example imgui code
I'm trying to bring in a context menu for convenient nodes creation