factory

package
v0.0.0-...-947f72b Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2025 License: GPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OnClose

type OnClose func()

gets called when the page[pageKey] is closed (out of view)

type PageFactory

type PageFactory func() tview.Primitive

PageFactory returns a tview.Primitive, encapsulates page creation logic

type PageManager

type PageManager struct {
	App    *tview.Application
	Pages  *tview.Pages
	Logger *logging.Logger
	// contains filtered or unexported fields
}

PageManager holds factories, optional (!!!) cache, and a navigation stack

func NewPageManager

func NewPageManager(logger *logging.Logger, app *tview.Application) *PageManager

creates a new pagemanager instance

func (*PageManager) HasPage

func (pm *PageManager) HasPage(pageKey string) bool

check if page exists (is factory for pageKey registered)

func (*PageManager) Pop

func (pm *PageManager) Pop() int

navigate backward

func (*PageManager) Push

func (pm *PageManager) Push(pageName string, keepCached bool)

func (*PageManager) RegisterFactory

func (pm *PageManager) RegisterFactory(name string, factory PageFactory, refresher Refresher, onClose OnClose)

RegisterFactory registers how to construct a page and an optional refresher if refresher is present, it will be called when page is shown

type Refresher

type Refresher func(p tview.Primitive)

Refresher updates an existing primitive when shown

Jump to

Keyboard shortcuts

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