November 2019
Beginner
436 pages
8h 52m
English
Given that we have two file management features, that is, Open and Save, now is an excellent time to introduce a dedicated application menu entry so that users can use a mouse to perform these operations.
Before we proceed with the application menu templates, let's refactor our file handling a bit to make the code more reusable. Don't forget that we need to call the dialogs from the menu item click handlers as well. Let's get started:
function saveFile() { console.log('Saving the file'); const window = BrowserWindow.getFocusedWindow(); window.webContents.send('editor-event', 'save'); }
Read now
Unlock full access