1
0
mirror of https://github.com/ocornut/imgui.git synced 2025-01-30 11:37:29 +01:00

Tweak context menu example

This commit is contained in:
ocornut 2015-05-27 21:42:16 +01:00
parent 90db64d4e3
commit 99ff45ad2e

View File

@ -10617,7 +10617,7 @@ void ImGui::ShowTestWindow(bool* opened)
} }
static float value = 0.5f; static float value = 0.5f;
ImGui::PushItemWidth(100); ImGui::DragFloat("Context Menu", &value); ImGui::PopItemWidth(); ImGui::Text("Value = %.3f", value);
if (ImGui::IsItemHovered() && ImGui::IsMouseClicked(1)) if (ImGui::IsItemHovered() && ImGui::IsMouseClicked(1))
ImGui::OpenPopup("context menu"); ImGui::OpenPopup("context menu");
ImGui::SameLine(); ImGui::Text("<-- right-click"); ImGui::SameLine(); ImGui::Text("<-- right-click");