[v3 example] menu text toggle

This commit is contained in:
Travis McLane
2023-05-11 11:10:17 -05:00
parent fe549af784
commit 8ff0a2b0ff
+6 -1
View File
@@ -29,7 +29,12 @@ func main() {
// Click callbacks
myMenu.Add("Click Me!").OnClick(func(ctx *application.Context) {
ctx.ClickedMenuItem().SetLabel("Thanks mate!")
switch ctx.ClickedMenuItem().Label() {
case "Click Me!":
ctx.ClickedMenuItem().SetLabel("Thanks mate!")
case "Thanks mate!":
ctx.ClickedMenuItem().SetLabel("Click Me!")
}
})
// You can control the current window from the menu