router

package
v0.0.0-...-a44c12d Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyLayout

type KeyLayout struct {
	DrawIndex int
	Layout    LayoutFunc
}

type LayoutFunc

type LayoutFunc func(gtx layout.Context, th *material.Theme)

type Page

type Page interface {
	Layout(gtx layout.Context, th *material.Theme) layout.Dimensions
	IsActive() bool
	Enter()
	Leave()
}

type Router

type Router struct {
	Pages   map[interface{}]Page // does not keep ordering with range (use drawOrder)
	Current interface{}
	// contains filtered or unexported fields
}

func NewRouter

func NewRouter() *Router

func (*Router) Add

func (router *Router) Add(tag interface{}, page Page)

func (*Router) AddLayout

func (router *Router) AddLayout(keyLayout KeyLayout)

func (*Router) Layout

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

func (*Router) SetCurrent

func (router *Router) SetCurrent(tag interface{})

Jump to

Keyboard shortcuts

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