ImGui.NET icon indicating copy to clipboard operation
ImGui.NET copied to clipboard

Popups

Open MetalDeveloper opened this issue 2 years ago • 1 comments

is their an example of popups that I could look at?

MetalDeveloper avatar Jan 23 '24 20:01 MetalDeveloper

Do you mean something like this?

if (ImGui.Begin("Main Window", ImGuiWindowFlags.NoCollapse))
{
	if (ImGui.BeginPopup("PopupName"))
	{
		ImGui.Text("Test popup");

		if (ImGui.Button("Close popup"))
			ImGui.CloseCurrentPopup();

		ImGui.EndPopup();
	}

	if (ImGui.Button("Open popup"))
		ImGui.OpenPopup("PopupName");
}

ImGui.End();

I recommend using imgui_demo.cpp as a reference: https://github.com/ocornut/imgui/blob/master/imgui_demo.cpp

The ImGui demo is really good and showcases almost everything you need. Whenever I'm not sure how to do something, I open the demo in C# by calling ImGui.ShowDemoWindow();, find whatever I need, and then look at how it's done in imgui_demo.cpp.

NoahStolk avatar Feb 06 '24 18:02 NoahStolk