Skip to content
Brandon Jordan edited this page Jan 31, 2023 · 2 revisions

Most of ttuy's internal widgets use these cursor functions. These functions just basically print out ANSI escape sequences that cause the terminal cursor to move around.

BackUp()

Go back up the number of lines that lineNext() has gone down. This is mainly used by Painter().


LineUp(lines int)

Move the cursor up lines number of lines.


LineDown(lines int)

Move the cursor down lines number of lines.


LineNext(lines int)

Move to the next line lines number of times.


LinePrev(lines int)

Move to the previous line lines number of times.


LineFeed()

A line feed moves to the next line once and scrolls up once.


Cursor(row int, col int)

Move cursor to row row and column col.


CursorFwd(columns int)

Move the cursor forward columns number of columns.


CursorBack(columns int)

Move the cursor back columns number of columns.


CursorStart()

Move the cursor to the start of the current line.


CursorHide()

Hide the cursor. This will hide the cursor until it is shown again, so make sure to use CursorShow() before the end of your program or widget.


CursorShow()

Show the cursor.


ClearLine()

Clear the current line.


ClearDisplay()

Clear the entire terminal display


ScrollUp(lines int)

Scroll the terminal up lines number of lines.


ScrollDown(lines int)

Scroll the terminal down lines number of lines.

Clone this wiki locally