pages

package
v1.29.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Pages = map[string]func(*Router) Page{}

Functions

func Register

func Register(name string, fun func(*Router) Page)

Types

type HandlerFunc

type HandlerFunc = func(data interface{}) messages.MessageResponse

type Page

type Page interface {
	Actions() []component.AppBarAction
	Overflow() []component.OverflowAction
	Layout(gtx layout.Context, th *material.Theme) layout.Dimensions
	NavItem() component.NavItem

	// handle events from program
	Handler(data any) messages.MessageResponse
}

type Router

type Router struct {
	Ctx        context.Context
	Wg         sync.WaitGroup
	Invalidate func()

	Theme *material.Theme

	*component.ModalNavDrawer
	NavAnim component.VisibilityAnimation
	*component.AppBar
	*component.ModalLayer
	NonModalDrawer, BottomBar bool
	// contains filtered or unexported fields
}

func NewRouter

func NewRouter(ctx context.Context, invalidate func(), th *material.Theme) Router

func (*Router) Handler

func (r *Router) Handler(data interface{}) messages.MessageResponse

func (*Router) Layout

func (r *Router) Layout(gtx layout.Context, th *material.Theme) layout.Dimensions

func (*Router) Register

func (r *Router) Register(tag string, p Page)

func (*Router) SwitchTo

func (r *Router) SwitchTo(tag string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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