-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Description
Calling menu.Update() doesn't re-render the UI in real time. It only changes when I reopen the System Tray menu. I'm not sure if this is due to my incorrect usage.
app := application.New(application.Options{
Name: "Systray Demo",
Description: "A demo of the Systray API",
})
systemTray := app.SystemTray.New()
if runtime.GOOS == "darwin" {
systemTray.SetTemplateIcon(icons.SystrayMacTemplate)
}
myMenu := app.NewMenu()
loading := myMenu.Add("loading...")
systemTray.SetMenu(myMenu)
go func() {
for i := 0; i <= 100; i++ {
time.Sleep(1 * time.Second)
loading.SetLabel("Loading " + strconv.Itoa(i))
myMenu.Update()
}
}()
err := app.Run()
if err != nil {
log.Fatal(err)
}
Metadata
Metadata
Assignees
Labels
No labels