You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
I'd be willing to address this documentation request myself.
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: