Documentation ¶
Overview ¶
Package canvas defines the canvas that the widgets draw on.
Index ¶
- type Canvas
- func (c *Canvas) Apply(t terminalapi.Terminal) error
- func (c *Canvas) Area() image.Rectangle
- func (c *Canvas) Cell(p image.Point) (*cell.Cell, error)
- func (c *Canvas) Clear() error
- func (c *Canvas) CopyTo(dst *Canvas) error
- func (c *Canvas) SetAreaCellOpts(cellArea image.Rectangle, opts ...cell.Option) error
- func (c *Canvas) SetAreaCells(cellArea image.Rectangle, r rune, opts ...cell.Option) error
- func (c *Canvas) SetCell(p image.Point, r rune, opts ...cell.Option) (int, error)
- func (c *Canvas) SetCellOpts(p image.Point, opts ...cell.Option) error
- func (c *Canvas) Size() image.Point
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 (*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) CopyTo ¶
CopyTo copies the content of this canvas onto the destination canvas. This canvas can have an offset when compared to the destination canvas, i.e. the area of this canvas doesn't have to be zero-based.
func (*Canvas) SetAreaCellOpts ¶
SetAreaCellOpts is like SetCellOpts, but sets the specified options on all the cells within the provided area.
func (*Canvas) SetAreaCells ¶
SetAreaCells is like SetCell, but sets the specified rune and options on all the cells within the provided area. This method is idempotent.
func (*Canvas) SetCell ¶
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) SetCellOpts ¶
SetCellOpts sets options on the specified cell of the canvas without modifying the content of the cell. Sets the default cell options if no options are provided. This method is idempotent.
Directories ¶
Path | Synopsis |
---|---|
Package braille provides a canvas that uses braille characters.
|
Package braille provides a canvas that uses braille characters. |
testbraille
Package testbraille provides helpers for tests that use the braille package.
|
Package testbraille provides helpers for tests that use the braille package. |
Package testcanvas provides helpers for tests that use the canvas package.
|
Package testcanvas provides helpers for tests that use the canvas package. |