climenu

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: Unlicense Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ButtonType = iota
	CheckboxType
)

Variables

This section is empty.

Functions

func GetText

func GetText(message string, defaultText string) string

Types

type ButtonMenu

type ButtonMenu struct {
	Menu
}

func NewButtonMenu

func NewButtonMenu(heading string, question string) *ButtonMenu

func (*ButtonMenu) Run

func (m *ButtonMenu) Run() (string, bool)

type CheckboxMenu

type CheckboxMenu struct {
	Menu
	Yes string
	No  string
}

func NewCheckboxMenu

func NewCheckboxMenu(heading string, question string, yes string, no string) *CheckboxMenu

func (*CheckboxMenu) Run

func (m *CheckboxMenu) Run() ([]string, bool)
type Menu struct {
	Type      int
	Heading   string
	Question  string
	CursorPos int
	MenuItems []*MenuItem
}

func NewMenu

func NewMenu(heading string, question string, menuType int) *Menu
func (m *Menu) AddMenuItem(text string, id string) *MenuItem
func (m *Menu) CursorDown()
func (m *Menu) CursorUp()
func (m *Menu) DrawMenuItems(redraw bool)
func (m *Menu) Dump()
func (m *Menu) DumpIndent(indent int)
func (m *Menu) Render()
func (m *Menu) RunInternal() (results []string, escape bool)
func (m *Menu) ToggleSelection()
type MenuItem struct {
	Text     string
	ID       string
	SubMenu  *Menu
	Selected bool // For checkboxes.
}
func (mi *MenuItem) SetSubMenu(menu *Menu)

Jump to

Keyboard shortcuts

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