gui

package
v0.0.0-...-412ee12 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2021 License: BSD-3-Clause, BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GuiApplication

type GuiApplication struct {
	Context  context.Context // used to broadcast application shutdown
	Shutdown func()          // shut down all windows
	Theme    *material.Theme // the application wide theme
	// contains filtered or unexported fields
}

GuiApplication keeps track of all the windows and global state.

func GlobalGui

func GlobalGui() *GuiApplication

func NewApplication

func NewApplication(ctx context.Context) *GuiApplication

func (*GuiApplication) CloseLog

func (a *GuiApplication) CloseLog()

func (*GuiApplication) Log

func (a *GuiApplication) Log() *Log

Wait waits for all windows to close.

func (*GuiApplication) NewWindow

func (a *GuiApplication) NewWindow(title string, view View, opts ...app.Option)

NewWindow creates a new tracked window.

func (*GuiApplication) Wait

func (a *GuiApplication) Wait()

type Log

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

Log shows a list of strings.

func (*Log) Layout

func (log *Log) Layout(w *Window, th *material.Theme, gtx layout.Context)

func (*Log) Printf

func (log *Log) Printf(format string, args ...interface{})

Printf adds a new line to the log.

func (*Log) Run

func (log *Log) Run(w *Window) error

Run handles window loop for the log.

type View

type View interface {
	// Run handles the window event loop.
	Run(w *Window) error
}

View describes .

type WidgetView

type WidgetView func(gtx layout.Context) layout.Dimensions

WidgetView allows to use layout.Widget as a view.

func NewImageView

func NewImageView(img image.Image) (WidgetView, []app.Option, error)

func (WidgetView) Run

func (view WidgetView) Run(w *Window) error

Run displays the widget with default handling.

type Window

type Window struct {
	App *GuiApplication
	*app.Window
}

Window holds window state.

Jump to

Keyboard shortcuts

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