-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
BeginMenu with columns #1149
Comments
Thanks. I won't have to time to look at it right away, Columns are notoriously in need for a rewrite for many different reasons. Not, I'm not sure exactly which bug you are referring too, with your repro ImGui::Begin("Bug #1149");
if( ImGui::BeginMenu( "Endpoints" ) )
{
if (ImGui::BeginMenu("New Endpoint"))
{
ImGui::Text( "Create Endpoint" );
ImGui::Button("create");
ImGui::EndMenu();
}
ImGui::Columns(4, "endpoints-view", false);
ImGui::Separator();
ImGui::Text( "Protocol" ); ImGui::NextColumn();
ImGui::Text( "Name" ); ImGui::NextColumn();
ImGui::Text( "Ip" ); ImGui::NextColumn();
ImGui::Text( "Port" ); ImGui::NextColumn();
ImGui::Separator();
for (int n = 0; n < 10; n++)
{
ImGui::Text( "blah" ); ImGui::NextColumn();
ImGui::Text( "this is a name" ); ImGui::NextColumn();
ImGui::Text( "192.168.255.255" ); ImGui::NextColumn();
ImGui::Text( "1234" ); ImGui::NextColumn();
}
ImGui::Columns(1);
ImGui::EndMenu();
}
ImGui::End(); Which is visibly clipped, so arguably a bug from user's point of view, but not news as Columns do not have any sizing policy at the moment, so the whole columns set is spreading within available space. As a ugly workaround to explicitly enlarge the menu you use, e.g.
As pointed out, adding the columns separator gives odd resizing behavior. At the moment I would suggest using SameLine() with known X positions to simulate cheap columns (but that would limit your field size). Sorry it's not great :( |
Closing this as
Equivalent test with Tables. ImGui::Begin("Bug #1149");
if (ImGui::BeginMenu("Endpoints"))
{
if (ImGui::BeginMenu("New Endpoint"))
{
ImGui::Text("Create Endpoint");
ImGui::Button("create");
ImGui::EndMenu();
}
if (ImGui::BeginTable("endpoints-view", 4, ImGuiTableFlags_ColumnsWidthFixed | ImGuiTableFlags_Borders))
{
ImGui::TableNextColumn(); ImGui::TableHeader("Protocol");
ImGui::TableNextColumn(); ImGui::TableHeader("Name");
ImGui::TableNextColumn(); ImGui::TableHeader("Ip");
ImGui::TableNextColumn(); ImGui::TableHeader("Port");
for (int n = 0; n < 10; n++)
{
ImGui::TableNextColumn(); ImGui::Text("blah");
ImGui::TableNextColumn(); ImGui::Text("this is a name");
ImGui::TableNextColumn(); ImGui::Text("192.168.255.255");
ImGui::TableNextColumn(); ImGui::Text("1234");
}
ImGui::EndTable();
}
ImGui::EndMenu();
}
ImGui::End(); |
Hi,
The columns don't seem to be working inside a menu, I reckon there is an issue with the resize so the content is clipped, If I use the border when I drag the handle it jumps.
The text was updated successfully, but these errors were encountered: