// Context Menu 1: right-click on header (including empty section after the third column!) should open Default Table Popup
ImGui::TableAutoHeaders();
for(introw=0;row<4;row++)
{
ImGui::TableNextRow();
for(intcolumn=0;column<COLUMNS_COUNT;column++)
{
ImGui::TableSetColumnIndex(column);
ImGui::PushID(row*COLUMNS_COUNT+column);
ImGui::Text("Cell %d,%d",column,row);
ImGui::SameLine();
// Context Menu 2: right-click on buttons open Custom Button Popup
ImGui::SmallButton("..");
if(ImGui::BeginPopupContextItem())
{
ImGui::Text("This is the popup for Button() On Cell %d,%d",column,row);
ImGui::Selectable("Close");
ImGui::EndPopup();
}
ImGui::PopID();
}
}
// Context Menu 3: Right-click anywhere in columns opens a custom popup
// We use the ImGuiPopupFlags_NoOpenOverExistingPopup flag to avoid displaying over either the standard TableHeader context-menu or the Button context-menu.