0
2つのブラウザが必要ですウィンドウ1つはメインウィンドウ、もう1つは子ウィンドウです私は子ウィンドウを設定したいです - メニューはメインウィンドウに反映されません。別のブラウザウィンドウは電子js内で異なるメニューオプションを持つ必要があります
app.on('ready', function() {
// Create new window
// this assign the mainwindow variable as a browserwindow with
// default parameter value which will take the entire page
mainWindow = new BrowserWindow({});
childWindow = new BroserWindow({});
// Load html in window
// the below function will load the html into the window using the
//Command pathname
mainWindow.loadURL(url.format({
pathname: path.join(__dirname, 'mainWindow.html'),
protocol: 'file:',
slashes: true
}));
childWindow.loadURL(url.format({
pathname: path.join(__dirname, 'childWindow.html'),
protocol: 'file:',
slashes: true
}));
//
Quit app when closed
mainWindow.on('closed', function() {
app.quit();
});
// Build menu from template
const mainMenu = Menu.buildFromTemplate(mainMenuTemplate);
// Insert menu
Menu.setApplicationMenu(mainMenu);
});
//here i need to set the menu option only to the child window
//not the main window
おかげでマイク、それは私のためにうまく働きました。! – dhanasekar