core

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 License: MIT Imports: 20 Imported by: 1

Documentation

Overview

Package core provides interaction with a browser required for widgets, `Widget` interface needed to be implemented by widget module, etc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddEventHandler

func AddEventHandler(w Widget, event string, handler func(ev Event))

func MountAssets

func MountAssets(assets embed.FS)

func SetHeadElements

func SetHeadElements(s string)

func SetTargetEvents

func SetTargetEvents(events []TargetEvent)

Types

type App

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

func NewApp

func NewApp(name string, width, height int, view Widget) *App

func (*App) PostUpdate

func (app *App) PostUpdate(w Widget)

func (*App) Run

func (app *App) Run()

type Event

type Event interface {
	ID() string
	Target() Widget
	EventName() string
	Props() map[string]interface{}
}

type TargetEvent

type TargetEvent struct {
	Name     string
	PropName string
}

type WebView2

type WebView2 struct{}

type Widget

type Widget interface {
	ID() WidgetID
	View() string
	Attach(app *App)
}

type WidgetID

type WidgetID int

func NewWidgetID

func NewWidgetID() WidgetID

func (WidgetID) String

func (id WidgetID) String() string

Jump to

Keyboard shortcuts

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