stack

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package stack demonstrates a screen stack: how screens are pushed and popped, how data flows between them, and how a screen replaces itself.

Parent → child: via the constructor. cityList pushes newCityDetail(city).
Child → parent: via Pop(result). timezonePicker calls Pop(chosenTZ),
                which lands in cityDetail.OnEnter(chosenTZ).
Self → self:    via Replace. Both the list and the detail bind r to
                screen.Replace(fresh instance of themselves) — an atomic
                top-of-stack swap. Stack depth doesn't change, nothing
                flickers, and the screen underneath is untouched: its
                OnEnter does not fire. A pop+push would do both.

Each screen uses a different layout to show that the stack doesn't care what its children look like — it just hosts layout.Node trees.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(t theme.Theme) screen.Screen

New returns the stack demo's root screen.

Types

This section is empty.

Jump to

Keyboard shortcuts

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