mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-12 06:59:30 +08:00
[v3 example] add menuitem.Hidden / setHidden example
This commit is contained in:
parent
a4549c94c1
commit
fe549af784
@ -82,7 +82,15 @@ func main() {
|
||||
beatles.SetLabel("Hello")
|
||||
}
|
||||
})
|
||||
|
||||
myMenu.Add("Hide the beatles").OnClick(func(ctx *application.Context) {
|
||||
if beatles.Hidden() {
|
||||
ctx.ClickedMenuItem().SetLabel("Unhide the beatles!")
|
||||
beatles.SetHidden(false)
|
||||
} else {
|
||||
beatles.SetHidden(true)
|
||||
ctx.ClickedMenuItem().SetLabel("Hide the beatles!")
|
||||
}
|
||||
})
|
||||
app.SetMenu(menu)
|
||||
|
||||
app.NewWebviewWindow()
|
||||
|
Loading…
Reference in New Issue
Block a user