climenu

package module
v0.0.0-...-a1afbb4 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2015 License: Unlicense Imports: 5 Imported by: 7

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)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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