AlexTorresDev / custom-electron-titlebar

Custom electon title bar inpire on VS Code title bar
MIT License
868 stars 149 forks source link

how to use menu, please give some examples #261

Open hanrongliao opened 2 months ago

hanrongliao commented 2 months ago
const menuTemp = {
  label: 'File',
  submenu: [
    {
      label: 'Save',
      click: () => {
        console.log('saved');
      },
    },
    { type: 'separator' },
    { role: 'quit' },
  ],
}

const menu = Menu.buildFromTemplate([menuTemp])

  // .... 

  Menu.setApplicationMenu(menu);
  attachTitlebarToWindow(mainWindow);

I writed this code in "main.js", but menu bar does not show