When I'm creating a menu in Fyne,I'm getting a cannot use fileMenuItem1 as string value error

Here is the code that I’m using to test Fyne.

package userinterface

import (

func Uirender() {
	myApp := app.New()
	myWindow := myApp.NewWindow("Hello World")

	// Create menu items
	fileMenuItem1 := fyne.NewMenuItem("File 1", nil)

	// Create a menu and add the menu items to it
	fileMenu := fyne.NewMenu(

	// Create a menu bar and set the menu to it
	mainMenu := fyne.NewMainMenu(

	// Set the menu bar as the window's main menu

	// Create a simple content for the window
	content := container.NewVBox(
		widget.NewLabel("Hello World!"),

	// Set the window's content

	// Show the window and run the app

Here is the error message

cannot use fileMenuItem1 (variable of type *fyne.MenuItem) as string value in argument to fyne.NewMenu

I haven’t seen much about this error with fyne on google,so I figured I’d ask here,

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.