vgshiny

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2020 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package vgshiny provides a vg.Canvas implementation backed by a shiny/screen.Window

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Canvas

type Canvas struct {
	*vgimg.Canvas
	// contains filtered or unexported fields
}

Canvas implements the vg.Canvas interface, drawing to a shiny.screen/Window buffer.

func New

func New(s screen.Screen, w, h vg.Length) (*Canvas, error)

New creates a new canvas with the given width and height.

func (*Canvas) Paint

func (c *Canvas) Paint() screen.PublishResult

Paint paints the canvas' content on the screen.

func (*Canvas) Release

func (c *Canvas) Release()

Release releases shiny/screen resources.

func (*Canvas) Run

func (c *Canvas) Run(f func(e interface{}) bool)

Run runs the function f for each event on the event queue of the underlying shiny window. f is expected to return true to continue processing events and false otherwise. If f is nil, a default processing function will be used. The default processing functions handles paint.Event events and exits when 'q' or 'ESC' are pressed.

func (*Canvas) Send

func (c *Canvas) Send(evt interface{})

Send sends an event to the underlying shiny window.

Jump to

Keyboard shortcuts

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