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

How to get individual ImGui table row/column data when hovered over or clicked on? #5142

Closed
apoorv569 opened this issue Mar 29, 2022 · 1 comment

Comments

@apoorv569
Copy link

So I have setup a ImGui::Table like this,
2022-03-29-16-02.png

I can hover over any row and it highlights the entire row.

Now I want that when the user clicks on any row, I want to be able to access any column's data for that row. How can I achieve this?

I found this function ImGui::TableGetHoveredColumn() but this gets me current hovered column not row.

@ocornut
Copy link
Owner

ocornut commented Mar 29, 2022

Now I want that when the user clicks on any row, I want to be able to access any column's data for that row. How can I achieve this?

I cannot understand your question.

You can use ImGui::Selectable() with the ImGuiSelectableFlags_SpanAllColumns flag in each row to tell when a row is clicked.

@ocornut ocornut closed this as completed Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants