5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-03 18:49:27 +08:00
wails/v2/internal/runtime/menu.go
2021-01-12 15:55:28 +11:00

26 lines
449 B
Go

package runtime
import (
"github.com/wailsapp/wails/v2/internal/servicebus"
)
// Menu defines all Menu related operations
type Menu interface {
UpdateApplicationMenu()
}
type menuRuntime struct {
bus *servicebus.ServiceBus
}
// newMenu creates a new Menu struct
func newMenu(bus *servicebus.ServiceBus) Menu {
return &menuRuntime{
bus: bus,
}
}
func (m *menuRuntime) UpdateApplicationMenu() {
m.bus.Publish("menu:updateappmenu", nil)
}