Have you read the Documentation Contribution Guidelines?
Description
in this section: https://v3alpha.wails.io/learn/systray/#attaching-a-window
The following code gives error in func()
Error: Cannot use 'func() { app. Quit() }' (type func()) as the type func(*Context)
app := application.New()
// Create system tray
systray := app.NewSystemTray()
systray.SetLabel("My App")
// Create a window
window := app.NewWebviewWindow()
// Attach the window to the system tray
systray.AttachWindow(window)
// Optional: Set window offset from tray icon
systray.WindowOffset(10)
// Optional: Set debounce time for window show/hide
systray.WindowDebounce(200 * time.Millisecond)
// Add a menu (optional)
menu := application.NewMenu()
menu.Add("Open").OnClick(func() {
window.Show()
})
menu.Add("Quit").OnClick(func() {
app.Quit()
})
systray.SetMenu(menu)
systray.Run()
Adding ctx *application.Context will fix the error
Self-service
Have you read the Documentation Contribution Guidelines?
Description
in this section: https://v3alpha.wails.io/learn/systray/#attaching-a-window
The following code gives error in func()
Error:
Cannot use 'func() { app. Quit() }' (type func()) as the type func(*Context)Adding ctx *application.Context will fix the error
Self-service