Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

how to use menu, please give some examples #261

Open
hanrongliao opened this issue Sep 13, 2024 · 0 comments
Open

how to use menu, please give some examples #261

hanrongliao opened this issue Sep 13, 2024 · 0 comments

Comments

@hanrongliao
Copy link

hanrongliao commented Sep 13, 2024

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant