Main Menu – Fyne GUI Golang tutorial 34
Main Menu – Fyne GUI Golang tutorial 34
package main // import fyne import ( "fyne.io/fyne/v2" "fyne.io/fyne/v2/app" ) func main() { // New app a := app.New() //app title w := a.NewWindow("Main Menu") // resize window w.Resize(fyne.NewSize(400, 400)) // first item menuItem := &fyne.Menu{ Label: "File", Items: nil, // we will add sub items in next video } menu := fyne.NewMainMenu(menuItem) // main menu // to remove error add & // Show main menu w.SetMainMenu(menu) /// we are done :) // w.ShowAndRun() }