actions

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActionName

func ActionName(label string) (actionName string)

ActionName converts the label name into the action name.

Types

type ActionGroupInserter

type ActionGroupInserter interface {
	primitives.Connector
	InsertActionGroup(prefix string, action glib.IActionGroup)
}
type Menu struct {
	*Stateful
	// contains filtered or unexported fields
}

func NewMenu

func NewMenu(prefix string) *Menu
func (m *Menu) AddAction(label string, call func())
func (m *Menu) BindRightClick(w ActionGroupInserter)
func (m *Menu) InsertActionGroup(w ActionGroupInserter)
func (m *Menu) MenuModel() (string, *glib.MenuModel)
func (m *Menu) Popup(relative gtk.IWidget)

Popup pops up the menu popover. It does not pop up anything if there are no menu items.

func (m *Menu) Prefix() string
func (m *Menu) RemoveAction(label string)
func (m *Menu) Reset()
type MenuButton struct {
	*gtk.MenuButton
	// contains filtered or unexported fields
}

func NewMenuButton

func NewMenuButton() *MenuButton
func (m *MenuButton) Bind(menu *Menu)

Bind binds the given menu. The menu's prefix MUST be a constant for this instance of the MenuButton.

type Stateful

type Stateful struct {
	glib.IActionGroup
	// contains filtered or unexported fields
}

Stateful is a stateful action group, which would allow additional methods that would otherwise be impossible to do with a simple Action Map.

func NewStateful

func NewStateful() *Stateful

func (*Stateful) AddAction

func (s *Stateful) AddAction(label string, call func())

func (*Stateful) Len

func (s *Stateful) Len() int

Len returns the number of menu entries.

func (*Stateful) LookupAction

func (s *Stateful) LookupAction(label string) *glib.Action

func (*Stateful) RemoveAction

func (s *Stateful) RemoveAction(label string)

func (*Stateful) Reset

func (s *Stateful) Reset()

Jump to

Keyboard shortcuts

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