-
-
Notifications
You must be signed in to change notification settings - Fork 11.7k
Appending to existing menus? #1207
Copy link
Copy link
Closed
Labels
Description
Is there a way that you can extend a menu that's already been created elsewhere? Quite often it's useful for sub-systems and unconnected bits of code to expose new commands etc in the main menu bar, but at the moment each call to BeginMenu() will create a new menu, rather than extending the previous instance of it.
Effectively, I want this code:
if(ImGui::BeginMenu("Test"))
{
ImGui::MenuItem("Test Item 1");
ImGui::EndMenu();
}
if(ImGui::BeginMenu("Test"))
{
ImGui::MenuItem("Test Item 2");
ImGui::EndMenu();
}
to behave as-if I'd simply done this:
if(ImGui::BeginMenu("Test"))
{
ImGui::MenuItem("Test Item 1");
ImGui::MenuItem("Test Item 2");
ImGui::EndMenu();
}
however I end up with two menus, that have aliased input, and a weird clipping issue with the second item's text:

Reactions are currently unavailable