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

Would be nice if TextBox lines was protected rather than private.... #619

Open
javafanboy opened this issue Oct 27, 2024 · 0 comments
Open

Comments

@javafanboy
Copy link

Firstly I want to say I REALLY like the idea of creating Lanterna and once I get really familiar with it I have a feeling I will use it for all kind of projects.
That said I am right now trying to create a kind of data browser using Lanterna where I want the user to be able to "scroll" through data read and processed from database tables. I would like to keep a fairly large buffer in memory (that I add rows to when it starts to get exhausted in one direction or the other) with a visible viewport on screen showing a part of buffer at the time.

Using the TextBox as a basis for this would be "almost" perfekt (would just need to override the scroll bar behaviour if I want it to reflect the viewports position in the database rather than within the buffer and change up/down arrows to add ) EXCEPT for that addLine only can insert a line at the end (and not at the beginning) making it impossible to "scroll" upwards as well as downwards :-(
I could have added a new method that allowed inserting also at the start but sadly the "lines" structure is private rather than "subclassing friendly" protected. I suppose some other changes may also be needed if allowing inserts at the start but maybe that could also be fixed by overriding?

If lines was not private I could even replace the standard "list implementation" with a custom one that incorporates transparently loading from the database as needed and this way not even have to modify the scrolls bars (as the size could be reported as the total rows in the database) etc...

P.S. Your name and profile picture tells me Sweden / Stockholm - if so maybe we run into each other in some IT event as that is my home town :-) Have you ever presented on Lanterna at some event or considering to do it? I would really love to know a bit more about your philosophy of the library...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant