Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Popups #461

Open
MetalDeveloper opened this issue Jan 23, 2024 · 1 comment
Open

Popups #461

MetalDeveloper opened this issue Jan 23, 2024 · 1 comment

Comments

@MetalDeveloper
Copy link

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

@NoahStolk
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants