Update example

This commit is contained in:
Lea Anthony 2022-10-12 20:59:02 +11:00
commit 804816dd6f
No known key found for this signature in database
GPG key ID: 33DAF7BB90A58405
2 changed files with 4 additions and 3 deletions

View file

@ -1,2 +1,3 @@
build/bin
node_modules
frontend/wailsjs

View file

@ -78,9 +78,9 @@ func main() {
// This is a menuitem we will show/hide at runtime
visibleNotVisible := menu.Label("visible?").Show()
var counter int
counter := 0
icons := [][]byte{lightModeIcon, darkModeIcon}
iconCounter := 1
iconCounter := 0
disabledEnabledMenu := menu.Label("disabled").Disable().OnClick(func(c *menu.CallbackData) {
println("Disabled item clicked!")
@ -112,8 +112,8 @@ func main() {
visibleNotVisible,
// This menu item changes its label when clicked.
menu.Label("Click Me!").OnClick(func(c *menu.CallbackData) {
c.MenuItem.SetLabel(fmt.Sprintf("Clicked %d times", counter))
counter++
c.MenuItem.SetLabel(fmt.Sprintf("Clicked %d times", counter))
systray.Update()
}),