Edit me

widget.Menu


import "fyne.io/fyne/v2/widget"

Usage

type Menu

type Menu struct {
	widget.Base
	Items     []fyne.CanvasObject
	OnDismiss func()
}

Menu is a widget for displaying a fyne.Menu.

func NewMenu

func NewMenu(menu *fyne.Menu) *Menu

NewMenu creates a new Menu.

func (*Menu) ActivateLastSubmenu

func (m *Menu) ActivateLastSubmenu() bool

ActivateLastSubmenu finds the last active menu item traversing through the open submenus and activates its submenu if any. It returns true if there was a submenu and it was activated and false elsewhere. Activating a submenu does show it and activate its first item.

func (*Menu) ActivateNext

func (m *Menu) ActivateNext()

ActivateNext activates the menu item following the currently active menu item. If there is no menu item active, it activates the first menu item. If there is no menu item after the current active one, it does nothing. If a submenu is open, it delegates the activation to this submenu.

func (*Menu) ActivatePrevious

func (m *Menu) ActivatePrevious()

ActivatePrevious activates the menu item preceding the currently active menu item. If there is no menu item active, it activates the last menu item. If there is no menu item before the current active one, it does nothing. If a submenu is open, it delegates the activation to this submenu.

func (*Menu) CreateRenderer

func (m *Menu) CreateRenderer() fyne.WidgetRenderer

CreateRenderer returns a new renderer for the menu.

Implements: fyne.Widget

func (*Menu) DeactivateChild

func (m *Menu) DeactivateChild()

DeactivateChild deactivates the active menu item and hides its submenu if any.

func (*Menu) DeactivateLastSubmenu

func (m *Menu) DeactivateLastSubmenu() bool

DeactivateLastSubmenu finds the last open submenu traversing through the open submenus, deactivates its active item and hides it. This also deactivates any submenus of the deactivated submenu. It returns true if there was a submenu open and closed and false elsewhere.

func (*Menu) Dismiss

func (m *Menu) Dismiss()

Dismiss dismisses the menu by dismissing and hiding the active child and performing OnDismiss.

func (*Menu) Hide

func (m *Menu) Hide()

Hide hides the menu.

Implements: fyne.Widget

func (*Menu) MinSize

func (m *Menu) MinSize() fyne.Size

MinSize returns the minimal size of the menu.

Implements: fyne.Widget

func (*Menu) Move

func (m *Menu) Move(pos fyne.Position)

Move sets the position of the widget relative to its parent.

Implements: fyne.Widget

func (*Menu) Refresh

func (m *Menu) Refresh()

Refresh triggers a redraw of the menu.

Implements: fyne.Widget

func (*Menu) Resize

func (m *Menu) Resize(size fyne.Size)

Resize has no effect because menus are always displayed with their minimal size.

Implements: fyne.Widget

func (*Menu) Show

func (m *Menu) Show()

Show makes the menu visible.

Implements: fyne.Widget

func (*Menu) Tapped

func (m *Menu) Tapped(*fyne.PointEvent)

Tapped catches taps on separators and the menu background. It doesn’t perform any action.

Implements: fyne.Tappable

func (*Menu) TriggerLast

func (m *Menu) TriggerLast()

TriggerLast finds the last active menu item traversing through the open submenus and triggers it.

Tags: