How to close the app over tray menu
Closed this issue · 2 comments
ThomasCybulski commented
Hi,
I'm struggling a bit to close the running application over the tray menu. I'm using the bundler and I added the following code:
TrayOptions: &astilectron.TrayOptions{
Image: astikit.StrPtr("resources/icon.png"),
Tooltip: astikit.StrPtr("Your tooltip"),
},
TrayMenuOptions: []*astilectron.MenuItemOptions{{
Label: astikit.StrPtr("Close"),
OnClick: func(e astilectron.Event) (deleteListener bool) {
// ?
return
},
}},
What can I insert in the OnClick function? Has anyone an idea?
Thanks!
asticode commented
Sure, you should be able to use the Quit method.
Let me know whether that fixes your problem.
ThomasCybulski commented
Thank you! Works fine!