gpt4 book ai didi

electron - Electron 应用程序使用纸盘图标重新激活窗口

转载 作者:行者123 更新时间:2023-12-03 12:35:50 26 4
gpt4 key购买 nike

当我们最小化应用程序时,如何使用“托盘”菜单对窗口进行 react

const tray = new Tray(path.join(__dirname, '/assets/icons/commusoft-squarelogo.png'))
const contextMenu = Menu.buildFromTemplate([
{ label: 'Active', type:'normal',role: 'front', click:try_click() },
{ label: 'Preferences', type: 'normal',click: try_click()},
{ label: 'Reload', type: 'normal', role: 'reload'},
{ label: 'Reload new', type: 'normal', role: 'reload'},
{ label: 'Quit', type: 'normal', role: 'quit' }
])
tray.setToolTip('This is my application.')
tray.setContextMenu(contextMenu)

提前致谢!!!

最佳答案

现在终于找到答案了

const contextMenu = Menu.buildFromTemplate([
{ label: 'Active', type:'normal',role: 'front', click:function(){
win.show()
}
},
{ label: 'Preferences', type: 'normal',click: try_click()},
{ label: 'Reload', type: 'normal', role: 'reload'},
{ label: 'Reload new', type: 'normal', role: 'reload'},
{ label: 'Quit', type: 'normal', role: 'quit' }
])

关于electron - Electron 应用程序使用纸盘图标重新激活窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47259168/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com