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
Scroll bars for tables and textviews #950
Comments
I don't think this will be added any time soon. Most widgets, especially text views and text areas, don't know their entire content, much less a laid out version of it. They gradually parse and layout text as the user navigates to it. Tables can also be "infinitely" large, see https://github.com/rivo/tview/blob/master/demos/table/virtualtable/main.go for an example. If we wanted to show scrollbars for a text view, for example, we'd have to parse its entire text first, including any style/region tags and word wrapping. This would be a huge performance hit on large texts. (Actually, it was like this in beginning and lots of people complained about bad performance.) I have plans to add functionality that might make it easier for you to add something like this yourself, however. Can't say right now, though, when this will be available. |
@darkhz @rivo Here is a few links of where you can see my fork implementing the for tablesfor textviewfor treeviewyou can see look into how they handle those calls, to generate scrollbars based on their current location and the total listings/etc. the actual call that is made to create/draw a scrollbar (will work on my ANY primitive based on boxhttps://github.com/digitallyserviced/tview/blob/611a26b9bad195005135a6ce0215280c68d57903/box.go#L833 Here is a gif where you can see the scrollbar being used in many different widgets... Lists, treeviews, tables, the pop-up animated context menus (a custom List element). forgive the speed of it, but you can see how my fork implements up and down arrows and also handling the size of the bar based on the ratio of the content. |
It would be good if scroll bars were shown for tables and textviews, so that the user can be notified about the position of the content and if there is any remaining content to be scrolled to.
The text was updated successfully, but these errors were encountered: