canvas

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package canvas defines the canvas that the widgets draw on.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Canvas

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

Canvas is where a widget draws its output for display on the terminal.

func New

func New(ar image.Rectangle) (*Canvas, error)

New returns a new Canvas with a buffer for the provided area.

func (*Canvas) Apply

func (c *Canvas) Apply(t terminalapi.Terminal) error

Apply applies the canvas to the corresponding area of the terminal. Guarantees to stay within limits of the area the canvas was created with.

func (*Canvas) Area

func (c *Canvas) Area() image.Rectangle

Area returns the area of the 2-D canvas.

func (*Canvas) Cell

func (c *Canvas) Cell(p image.Point) (*cell.Cell, error)

Cell returns a copy of the specified cell.

func (*Canvas) Clear

func (c *Canvas) Clear() error

Clear clears all the content on the canvas.

func (*Canvas) SetCell

func (c *Canvas) SetCell(p image.Point, r rune, opts ...cell.Option) (int, error)

SetCell sets the rune of the specified cell on the canvas. Returns the number of cells the rune occupies, wide runes can occupy multiple cells when printed on the terminal. See http://www.unicode.org/reports/tr11/. Use the options to specify which attributes to modify, if an attribute option isn't specified, the attribute retains its previous value.

func (*Canvas) Size

func (c *Canvas) Size() image.Point

Size returns the size of the 2-D canvas.

Directories

Path Synopsis
Package testcanvas provides helpers for tests that use the canvas package.
Package testcanvas provides helpers for tests that use the canvas package.

Jump to

Keyboard shortcuts

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