Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyCode ¶
type KeyCode byte
const ( Key_a KeyCode Key_b Key_c Key_d Key_e Key_f Key_g Key_h Key_i Key_j Key_k Key_l Key_m Key_n Key_o Key_p Key_q Key_r Key_s Key_t Key_u Key_v Key_w Key_x Key_y Key_z Key_A Key_B Key_C Key_D Key_E Key_F Key_G Key_H Key_I Key_J Key_K Key_L Key_M Key_N Key_O Key_P Key_Q Key_R Key_S Key_T Key_U Key_V Key_W Key_X Key_Y Key_Z Key_0 Key_1 Key_2 Key_3 Key_4 Key_5 Key_6 Key_7 Key_8 Key_9 )
type Menu ¶
type Menu struct {
Prompt string
CursorPos int
MenuItems []*MenuItem
ShortcutKeysMap map[KeyCode]int
// contains filtered or unexported fields
}
func NewMenu ¶
func NewMenu(prompt string, opts ...MenuOption) *Menu
func (*Menu) AddItemWithShortcutKey ¶
AddItemWithShortcutKey will add a new menu option with shortcut key to the menu list
type MenuOption ¶
type MenuOption func(menu *Menu)
func WithPageSize ¶
func WithPageSize(size int) MenuOption
func WithPrintShortcuts ¶
func WithPrintShortcuts(print bool) MenuOption
func WithSelectedColor ¶
func WithSelectedColor(color SelectedColor) MenuOption
type SelectedColor ¶
type SelectedColor int
const ( BLACK SelectedColor = goterm.BLACK RED SelectedColor = goterm.RED GREEN SelectedColor = goterm.GREEN YELLOW SelectedColor = goterm.YELLOW BLUE SelectedColor = goterm.BLUE MAGENTA SelectedColor = goterm.MAGENTA CYAN SelectedColor = goterm.CYAN WHITE SelectedColor = goterm.WHITE )
Click to show internal directories.
Click to hide internal directories.
