ImGuiNET / ImGui.NET

An ImGui wrapper for .NET.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Popups

MetalDeveloper opened this issue · comments

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

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.