TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: RICKMAN
from: MARTIN GREGORIE
date: 2017-10-21 22:37:00
subject: Re: Screen control

On Sat, 21 Oct 2017 17:11:47 -0400, rickman wrote:

> T M Smith wrote on 10/21/2017 4:04 PM:
>> I am sure this is elementary to most but bear with me please.
>> I am using Raspbian on a pi. How does one get a reading to print on
>> screen in the same place on a continueing basis rather than printing on
>> a new line and scrolling.
>
> Are you writing your own program?  What is the text coming from?
>
> If you just want to update the bottom line the program should send CR
> but no LF.  If you want the text to appear at a specific location on the
> screen, you can send ANSI codes I believe, but I'm not totally clear on
> how Linux does it.  But I believe each window is essentially a terminal
> emulator from the perspective of the program running in it.
>
Yep. Each console window is effectively a 24 x 80 colour screen. What
language is the program written it? That's relevant because many
languages have their own terminal management packages:

- Python has at least two
- Java has Swing and FX packages for displaying non-image data as well as
  image manipulation and display packages
- C has curses for writing editors like vi, etc, i.e. its meant for
  giving you fa-ne control of where you can write text to and receive
  input from a (typically) 24x80 character-mode terminal. There's also
  and also Gtk+ package for building 2D and 3D graphical displays.

GTK+ and Open GL support applications written in a variety of languages.

All of these have a fairly steep learning curve if you haven't used any
of them, but the concepts they use are all fairly similar, so once you've
understood one, using different graphical/terminal packages becomes a lot
easier.

I've implemented a version of Curses for Java, using the information and
API description in "Programming with Curses" (O'Reilly) partly because I
could and partly to convince myself that I understood Curses well enough
to do it.


--
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.