1 Star 0 Fork 21

jackey/Fyne

forked from Gitee 极速下载/Fyne 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
menu.go 1.07 KB
一键复制 编辑 原始数据 按行查看 历史
package fyne
// Menu stores the information required for a standard menu.
// A menu can pop down from a MainMenu or could be a pop out menu.
type Menu struct {
Label string
Items []*MenuItem
}
// NewMenu creates a new menu given the specified label (to show in a MainMenu) and list of items to display.
func NewMenu(label string, items ...*MenuItem) *Menu {
return &Menu{label, items}
}
// MenuItem is a sligne item within any menu, it contains a dispay Label and Action function that is called when tapped.
type MenuItem struct {
Label string
Action func()
}
// NewMenuItem creates a new menu item from the passed label and action parameters.
func NewMenuItem(label string, action func()) *MenuItem {
return &MenuItem{label, action}
}
// MainMenu defines the data required to show a menu bar (desktop) or other appropriate top level menu.
type MainMenu struct {
Items []*Menu
}
// NewMainMenu creates a top level menu structure used by fyne.Window for displaying a menubar
// (or appropriate equivalent).
func NewMainMenu(items ...*Menu) *MainMenu {
return &MainMenu{items}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/jackeyyao/Fyne.git
[email protected]:jackeyyao/Fyne.git
jackeyyao
Fyne
Fyne
master

搜索帮助