Version: v0.7.1 Latest Latest

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

Go to latest
Published: Mar 9, 2018 License: MIT Imports: 2 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type Item

type Item struct {
	Val   string
	Label string

func (Item) Text

func (m Item) Text() string

Use label as display text of item, if given

type Items

type Items []Item

func NewItems

func NewItems(items ...Item) (mitems Items)

func (Items) Len

func (m Items) Len() int

Sort methods for Items

func (Items) Less

func (m Items) Less(a, b int) bool

func (Items) Swap

func (m Items) Swap(a, b int)
type Menu struct {
	SortItems   bool   // enable automatic sorting of menu items
	SubText     string // optional text to display before items
	TextFgColor ui.Attribute
	TextBgColor ui.Attribute
	Selectable  bool
	// contains filtered or unexported fields

func NewMenu

func NewMenu() *Menu
func (m *Menu) AddItems(items ...Item)

Append Item to Menu

func (m *Menu) Buffer() ui.Buffer
func (m *Menu) DelItem(s string) (success bool)

Remove menu item by value or label

func (m *Menu) Down()
func (m *Menu) SelectedItem() Item
func (m *Menu) SetCursor(s string) (success bool)

Move cursor to an position by Item value or label

func (m *Menu) Up()

type Padding

type Padding [2]int // x,y padding

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL