macmenus

package
v0.0.0-...-af996ba Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2019 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Rendered for darwin/amd64

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppBar

func AppBar() menu.Bar

AppBar returns the application menu bar.

func Install

func Install()

Install the standard menu bar.

func NewItem

func NewItem(title string, handler event.Handler) menu.Item

NewItem creates a new item with no key accelerator.

func NewItemWithKey

func NewItemWithKey(title string, keyCode int, handler event.Handler) menu.Item

NewItemWithKey creates a new item with a key accelerator using the platform-default modifiers.

func NewItemWithKeyAndModifiers

func NewItemWithKeyAndModifiers(title string, keyCode int, modifiers keys.Modifiers, handler event.Handler) menu.Item

NewItemWithKeyAndModifiers creates a new item.

func NewMenu

func NewMenu(title string) menu.Menu

NewMenu creates a new menu.

func NewSeparator

func NewSeparator() menu.Item

NewSeparator creates a new separator item.

func SetHelpMenu

func SetHelpMenu(menu menu.Menu)

SetHelpMenu designates which menu is the help menu.

func SetServicesMenu

func SetServicesMenu(menu menu.Menu)

SetServicesMenu designates which menu is the services menu.

func SetWindowMenu

func SetWindowMenu(menu menu.Menu)

SetWindowMenu designates which menu is the window menu.

Types

type Bar

type Bar struct {
	// contains filtered or unexported fields
}

Bar represents a set of menus.

func (*Bar) AppendMenu

func (bar *Bar) AppendMenu(subMenu menu.Menu)

AppendMenu appends a menu at the end of this bar.

func (*Bar) Count

func (bar *Bar) Count() int

Count of items in this menu.

func (*Bar) InsertMenu

func (bar *Bar) InsertMenu(subMenu menu.Menu, index int)

InsertMenu inserts an item with a sub-menu at the specified item index within this menu. Pass in a negative index to append to the end.

func (*Bar) Menu

func (bar *Bar) Menu(index int) menu.Menu

Menu at the specified index, or nil.

func (*Bar) ProcessKeyDown

func (bar *Bar) ProcessKeyDown(evt *event.KeyDown)

ProcessKeyDown is called to process KeyDown events prior to anything else receiving them.

func (*Bar) Remove

func (bar *Bar) Remove(index int)

Remove the item at the specified index from this menu. This does not dispose of the menu item.

func (*Bar) SetupSpecialMenu

func (bar *Bar) SetupSpecialMenu(which menu.SpecialMenuType, mnu menu.Menu)

SetupSpecialMenu sets up the specified special menu, which must have already been installed into the menu bar.

func (*Bar) SpecialMenu

func (bar *Bar) SpecialMenu(which menu.SpecialMenuType) menu.Menu

SpecialMenu returns the specified special menu, or nil if it has not been setup.

Jump to

Keyboard shortcuts

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