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

Possible bug in tableview_select(...) #130

Open
SamSandq opened this issue Apr 14, 2024 · 2 comments
Open

Possible bug in tableview_select(...) #130

SamSandq opened this issue Apr 14, 2024 · 2 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@SamSandq
Copy link

According to the documentation, a call to tableview_select(....) should scroll the view so that the selected row is visible.

In my case, this row is consistently a few rows below the bottom of the table (if it is tall enough to fall below the view bottom), and thus not visible.

I have to use view_scroll_y((View *) myTableview, pos); with the appropriate values to cause it to be visible.

@frang75 frang75 self-assigned this Apr 16, 2024
@frang75
Copy link
Owner

frang75 commented Apr 16, 2024

Hi!
tableview_select() doesn't scroll. tableview_focus_row() does.
https://nappgui.com/en/gui/tableview.html#f28

@frang75 frang75 added the help wanted Extra attention is needed label Apr 16, 2024
@SamSandq
Copy link
Author

Unfortunately, neither tableview_select() nor tableview_focus_row() scrolls my table to the correct row. I use

 uint32_t h = tableview_get_row_height(app->collectionView);
    view_scroll_y((View *) app->collectionView, found*h);

with my own tableview_get_row_height(...).

That actually points to another small issue: I think you should always include a xxx_get_yyy(...)whenever you have a xxx_set_yyy(...).

This would be immensely useful when you want to make a temporary change, and revert back. Currently that is mostly not possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants