nappgui_src icon indicating copy to clipboard operation
nappgui_src copied to clipboard

Possible bug in tableview_select(...)

Open SamSandq opened this issue 10 months ago • 2 comments

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.

SamSandq avatar Apr 14 '24 11:04 SamSandq

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

frang75 avatar Apr 16 '24 15:04 frang75

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.

SamSandq avatar Apr 18 '24 10:04 SamSandq