menuutil

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package menuutil contains user-interface functions and helpers for termshark.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeMenu added in v2.3.0

func MakeMenu(items []SimpleMenuItem, sites SiteMap) (gowid.IWidget, int)

func MakeMenuNavigatingKeyPress

func MakeMenuNavigatingKeyPress(left *NextMenu, right *NextMenu) appkeys.KeyInputFn

func MakeMenuWithHotKeys

func MakeMenuWithHotKeys(items []SimpleMenuItem, sites SiteMap) (gowid.IWidget, int)
func MenuNavigatingKeyPress(evk *tcell.EventKey, left *NextMenu, right *NextMenu, app gowid.IApp) bool

Types

type NextMenu

type NextMenu struct {
	Cur        *menu.Widget
	Next       *menu.Widget // nil if menu is nil
	Site       *menu.SiteWidget
	Container  gowid.IFocus // container holding menu buttons, etc
	Focus      int          // index of next menu in container
	MenuOpener menu.IOpener // For integrating with UI app - the menu needs to be told what's underneath when opened
}

type SimpleMenuActionFunction added in v2.3.0

type SimpleMenuActionFunction func(app gowid.IApp, site menu.ISite)

type SimpleMenuItem

type SimpleMenuItem struct {
	Txt string
	Key gowid.IKey
	CB  gowid.WidgetChangedFunction
}

func MakeMenuDivider

func MakeMenuDivider() SimpleMenuItem

type SiteMap added in v2.3.0

type SiteMap map[gowid.IWidget]menu.ISite

Jump to

Keyboard shortcuts

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