I am using the custom-electron-titlebar module in order to create a customized titlebar. I am trying to change the items in the menu as shown in the documentation:
However, when i try to mimic the code shown above, it throws me an error while running the app:
Error :
Uncaught TypeError: Menu is not a constructor
Here is my code :
const { customTitlebar, Menu, Titlebar, Color, MenuItem } = require('custom-electron-titlebar');
titleBar = new Titlebar({
backgroundColor: Color.fromHex('#282a36'),
minimizable: false,
itemBackgroundColor: Color.fromHex('#44475a'),
})
const menu = new Menu();
menu.append(new MenuItem({
label: 'Item 1',
submenu: [
{
label: 'Subitem 1',
click: () => console.log('Click on subitem 1')
},
{
type: 'separator'
}
]
}));
console.log(menu)
titleBar.updateMenu(menu)
How do I fix this issue? I want to have customised menu-bar instead of the default ones!
Thanks a lot for you help!
