728x90
๋ฐ์ํ
const { app, BrowserWindow, Menu, Tray } = require('electron');
let tray = null
app.whenReady().then(() => {
tray = new Tray('./icon1.png');
var contextMenu = Menu.buildFromTemplate([
{ label: 'Hello world!', click: function(){
console.log('Hello world!');
tray.setImage('./icon2.png');
} },
{ label: 'Quit', click: function(){
app.quit();
} }
]);
tray.setContextMenu(contextMenu);
})
Tray ์์ฑ ๋ฐ ํด๋ฆญ ์ด๋ฒคํธ, Tray ์์ด์ฝ ๋ณ๊ฒฝ
์ถ์ฒ:
https://www.electronjs.org/docs/latest/api/tray
Tray | Electron
Add icons and context menus to the system's notification area.
www.electronjs.org
https://stackoverflow.com/questions/43689286/how-to-update-tray-icon
How to update tray icon
In Electron, it is possible to create a tray icon by using new Tray(image), for example: let iconPath = path.join(__dirname, 'icon.png'); appIcon = new Tray(iconPath); As stated in the documentat...
stackoverflow.com
728x90
๋ฐ์ํ
'๐ฅ๏ธํ๋ก ํธ์๋ > Electron.js' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Electron - loadURL๋ก ๋ฌธ์ ๋ถ๋ฌ์จ ํ์ ์๋ฐ์คํฌ๋ฆฝํธ ์คํ (0) | 2022.04.01 |
---|---|
Electron - ๋ ๋๋ฌ๊ฐ ๋ฉ์ธ์๊ฒ ์ ํธ ๋ณด๋ด๊ธฐ(ipcMain & ipcRenderer) (0) | 2022.03.28 |
Electron - ๋ง์ฐ์ค ๋๋๊ทธ๋ก ์ฐฝ ์์ง์ด๊ธฐ (0) | 2022.03.28 |
Electron - ๋ก๋๊ฐ ๋ค๋ํ์ ์ฐฝ ๋์ฐ๊ธฐ (0) | 2022.03.27 |
Electron - ํด๋ฆฝ๋ณด๋ ์กฐ์ (0) | 2022.03.27 |