Skip to content

Commit 47766ca

Browse files
committed
Demo: fix in 'Demo->Selection->Multi-Select in a Table' section.
1 parent 7c6febe commit 47766ca

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

imgui_demo.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2863,7 +2863,7 @@ static void DemoWindowWidgetsSelectionAndMultiSelect(ImGuiDemoWindowData* demo_d
28632863

28642864
const int ITEMS_COUNT = 10000;
28652865
ImGui::Text("Selection: %d/%d", selection.Size, ITEMS_COUNT);
2866-
if (ImGui::BeginTable("##Basket", 2, ImGuiTableFlags_ScrollY | ImGuiTableFlags_RowBg | ImGuiTableFlags_BordersOuter))
2866+
if (ImGui::BeginTable("##Basket", 2, ImGuiTableFlags_ScrollY | ImGuiTableFlags_RowBg | ImGuiTableFlags_BordersOuter, ImVec2(0.0f, ImGui::GetFontSize() * 20)))
28672867
{
28682868
ImGui::TableSetupColumn("Object");
28692869
ImGui::TableSetupColumn("Action");
@@ -2884,13 +2884,15 @@ static void DemoWindowWidgetsSelectionAndMultiSelect(ImGuiDemoWindowData* demo_d
28842884
{
28852885
ImGui::TableNextRow();
28862886
ImGui::TableNextColumn();
2887+
ImGui::PushID(n);
28872888
char label[64];
28882889
sprintf(label, "Object %05d: %s", n, ExampleNames[n % IM_ARRAYSIZE(ExampleNames)]);
28892890
bool item_is_selected = selection.Contains((ImGuiID)n);
28902891
ImGui::SetNextItemSelectionUserData(n);
28912892
ImGui::Selectable(label, item_is_selected, ImGuiSelectableFlags_SpanAllColumns | ImGuiSelectableFlags_AllowOverlap);
28922893
ImGui::TableNextColumn();
28932894
ImGui::SmallButton("hello");
2895+
ImGui::PopID();
28942896
}
28952897
}
28962898

0 commit comments

Comments
 (0)