new to group. Scrolling question

29 views
Skip to first unread message

Jeffrey Gaynor

unread,
May 20, 2020, 10:08:03 AM5/20/20
to lanterna-discuss
Hi!

I am new to Lanterna and evaluating it for possible use in several projects.  I have a couple of probably easy questions but the documentation, while a good and simple intro, does not go into enough depth to address.

Basically we have a bunch of mature text applications (plain old Java, so nothing like cursor addressing) we'd like to upgrade to be much more full featured. The basic operation should be a terminal window and we want window popups (e.g. alt+F pulls up file dialog and inserts result at prompt). Rewriting the tools is really not much of an option, but augementing them and their function is. 

What I need is scrolling (page up and down -- can't get to work,reason for this post), command history (done), popup support (to do, want to be sure I'm on the right path first)

* Ideally: Is there a class that simply embeds  terminal window with either scroll bars or scrolling (page up down) into a GUI? 

* How to use the scrollLines call? I can get it to work but it of course erases the screen as it goes. This means things get erased. Am I missing some refresh feature to get the lines from the back buffer? If the user cannot move around their history this method seems not too useful and just a fancy way to clear the screen.

* Cutting text and pasting it into my current example is really, really slow -- like a few characters per second. Is this normal?

Thanks!

Jeff

Martin Berglund

unread,
May 31, 2020, 2:05:50 AM5/31/20
to lanterna...@googlegroups.com
Hi Jeff,
To answer your questions, you should probably look at the GUI layer. Lanterna has three conceptual layers, where the lowest deals directly with the terminal without any state, the middle layer has a "buffer" of the content on screen and lets you do bitmap-like interactions and then finally the third layer is a UI implementation. If you want scrollable text areas, there is a TextBox component in the UI layer that can do this. But if you want to keep things simple and not use the UI layer, you'll have to implement scrolling yourself by maintaining state that you copy into the Screen buffer based on what should currently be visible. The scrollLines call is probably not what you're looking for.

Regards,
Martin

--
Det här meddelandet skickas till dig eftersom du prenumererar på gruppen "lanterna-discuss" i Google Grupper.
Om du vill sluta prenumerera på den här gruppen och inte längre få någon e-post från den skickar du ett e-postmeddelande till lanterna-discu...@googlegroups.com.
Om du vill visa den här diskussionen på webben besöker du https://groups.google.com/d/msgid/lanterna-discuss/dbbf22be-9e92-4241-be0d-a3aec79eb6c1%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages