menu

package
v0.0.0-...-fc775d1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Menu struct {
	Title       string
	Items       []*MenuItem
	CurrentItem int
	Parent      *Menu
	ExitAction  func()
}

Menu represents a menu with items and navigation

func (m *Menu) AddMenuItem(id, title, description string, action func() error)

AddMenuItem adds a menu item to the current menu

func (m *Menu) AddSubMenu(id, title, description string) *Menu

AddSubMenu adds a submenu to a menu item

func (m *Menu) Display()

Display renders the current menu

type MenuItem struct {
	ID          string
	Title       string
	Description string
	Action      func() error
	SubMenu     *Menu
}

MenuItem represents a single menu option

type MenuSystem struct {
	CurrentMenu       *Menu
	RootMenu          *Menu
	IsActive          bool
	ProgressIndicator interface {
		Pause()
		Resume()
		IsPaused() bool
		Stop()
		Start()
	}
	Blockchain interface {
		SetMenuActive(bool)
	}
}

MenuSystem manages the overall menu system

func CreateBlockchainMenu

func CreateBlockchainMenu(blockchain *sdk.Blockchain) *MenuSystem

BlockchainMenu creates the main blockchain menu system

func NewMenuSystem

func NewMenuSystem() *MenuSystem

NewMenuSystem creates a new menu system

func (ms *MenuSystem) Navigate() error

Navigate handles menu navigation

Jump to

Keyboard shortcuts

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