mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 14:45:49 +01:00
Update example
This commit is contained in:
parent
4fe1aff55e
commit
804816dd6f
2 changed files with 4 additions and 3 deletions
1
v2/examples/systray/.gitignore
vendored
1
v2/examples/systray/.gitignore
vendored
|
|
@ -1,2 +1,3 @@
|
|||
build/bin
|
||||
node_modules
|
||||
frontend/wailsjs
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
}),
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue