menu

package
v0.0.0-...-6513b37 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2021 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindItemFunc

func FindItemFunc(items []Item, name string) func()

FindItemFunc iterates over the list of items and returns the first item with the matching name.

func MenuItems(menu MenuAppender, items []Item)
func MenuSeparator(menu MenuAppender)

func ToolbarItems

func ToolbarItems(toolbar ToolbarInserter, items []Item)

ToolbarItems insert the given items into the toolbar.

func ToolbarSeparator

func ToolbarSeparator(toolbar ToolbarInserter)

Types

type Item

type Item struct {
	Icon  string
	Name  string
	Func  func()
	Extra func(*gtk.MenuItem)
}

func SimpleItem

func SimpleItem(name string, fn func()) Item

func (Item) ToMenuItem

func (item Item) ToMenuItem() *gtk.MenuItem

func (Item) ToToolButton

func (item Item) ToToolButton() *gtk.ToolButton

type LazyMenu

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

LazyMenu is a menu with lazy-loaded capabilities.

func NewLazyMenu

func NewLazyMenu(bindTo primitives.Connector) *LazyMenu

func (*LazyMenu) AddItems

func (m *LazyMenu) AddItems(items ...Item)

func (*LazyMenu) AddSimpleItem

func (m *LazyMenu) AddSimpleItem(name string, fn func())

func (*LazyMenu) PopupAtPointer

func (m *LazyMenu) PopupAtPointer(ev *gdk.Event)

func (*LazyMenu) Reset

func (m *LazyMenu) Reset()

func (*LazyMenu) SetItems

func (m *LazyMenu) SetItems(items []Item)
type MenuAppender interface {
	Append(gtk.IMenuItem)
}

type ToolbarInserter

type ToolbarInserter interface {
	Insert(gtk.IToolItem, int)
}

Jump to

Keyboard shortcuts

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