screen

package
v0.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Display

type Display struct {
	// contains filtered or unexported fields
}

Display represents a display that can draw elements to the screen.

func NewDisplay

func NewDisplay(bgStyle tcell.Style) (*Display, error)

NewDisplay creates a new display with the given background style.

Parameters:

  • bgStyle: The background style of the display.

Returns:

  • *Display: The new display.
  • error: An error if the display could not be created.

func (*Display) Close

func (d *Display) Close()

Close closes the display.

func (*Display) Draw

func (d *Display) Draw(elem dtb.Displayer)

Draw draws an element to the display.

Parameters:

  • elem: The element to draw.

func (*Display) ListenForKey

func (d *Display) ListenForKey() (rune, bool)

ListenForKey listens for a key event.

Returns:

  • rune: The key.
  • bool: True if the key was received, false otherwise.

func (*Display) ListenForNumber

func (d *Display) ListenForNumber() (int, error)

ListenForNumber listens for a number.

Returns:

  • int: The number.
  • error: An error if the number could not be received.

func (*Display) ReceiveErr

func (d *Display) ReceiveErr() (error, bool)

ReceiveErr receives an error from the display.

Returns:

  • error: The error.
  • bool: True if the error was received, false otherwise.

func (*Display) Start

func (d *Display) Start()

Start starts the display.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL