Imagine I want to add a context menu on node content. In the sample.cpp:
// Custom node content may go here
ImGui::Text("Content of %s", node->Title);
const char* names[5] = { "Label1", "Label2", "Label3", "Label4", "Label5" };
for (int n = 0; n < 5; n++)
{
ImGui::Selectable(names[n]);
if (ImGui::BeginPopupContextItem()) // <-- use last item id as popup id
{
ImGui::Text("This a popup for \"%s\"!", names[n]);
if (ImGui::Button("Close"))
ImGui::CloseCurrentPopup();
ImGui::EndPopup();
}
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Right-click to open popup");
}
This is just pasted from imgui_demo.cpp
This doesn't work. Only the context menu for adding nodes is opened.
Imagine I want to add a context menu on node content. In the sample.cpp:
This is just pasted from imgui_demo.cpp
This doesn't work. Only the context menu for adding nodes is opened.