frang75 / nappgui_src

SDK for building cross-platform desktop apps in ANSI-C
https://www.nappgui.com
MIT License
442 stars 43 forks source link

Possible bug in tableview_select(...) #130

Open SamSandq opened 1 month ago

SamSandq commented 1 month ago

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 commented 1 month ago

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

SamSandq commented 4 weeks ago

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.