saltyshiomix / nextron

⚡ Next.js + Electron ⚡
https://npm.im/nextron
MIT License
3.69k stars 215 forks source link

Nextron tray menue #395

Closed noevermaurice closed 9 months ago

noevermaurice commented 10 months ago

I would like to use the electron tray menu in nextron for macOS how do i implement this and where ? please code example

makeusabrew commented 9 months ago

Disclaimer: I'm only just getting started with Nextron, but...

As far as I can tell, creating a tray menu is exactly the same as in a normal Electron app. So, the best code example to start off with would be the official Electron Tray docs.

You can configure your tray once app.whenReady() has fired, e.g. you could create and configure it around here: https://github.com/saltyshiomix/nextron/blob/main/examples/_template/ts/main/background.ts#L15

(Note that in the official Electron examples the tray object is declared outside of the promise callback, which you should respect - I believe it's to stop the object being accidentally garbage collected).

saltyshiomix commented 9 months ago

@makeusabrew Thank you for your comment!

@noevermaurice Any updates on this?