Transcript from the "Secondary Menubar Menu" Lesson
>> Steve Kinney: Let's create a very simple menu, and we'll do it all kind of in this ready event. So const secondaryMenu, cuz this is not an application menu, cuz we don't really have an application menu anymore, is Menu,
>> Steve Kinney: Yep, cool, Menu.buildfromtemplate.
>> Steve Kinney: And we'll just give this one label.
>> Steve Kinney: We'll call it Quit, and we'll say click, and the main thing I want to show you is if you need the actual app instance you can do menubar.app.quit(), right? You can actually get the one browser window instance the same way.
>> Steve Kinney: And we'll use the accelerator of CommandOrControl+Q.
[00:00:57] And then we'll go ahead and take the menu bar and say, tray and we'll do it. So the menu bar, remember, we saw menubar.app, and we'll go quit, menubar.tray is the tray instance that is also creating that little cat up there. We'll say on right-click.
>> Steve Kinney: Then we'll say menubar.tray.popUpContextMenu with that secondary menu.
[00:01:35] So we can access that tray module directly the same way we can access the app. Menu bars simply are an abstraction over all those things, it just gets those very native electron things and wires them all for you.
>> Steve Kinney: There it is.
>> Steve Kinney: The template for Menu, that's because it's gotta be an array.
>> Steve Kinney: Let it start up.
>> Steve Kinney: There is a menu that you can also right click on it and get this quick menu now too, right? So you can build applications that live outside. So one of things I want you to think about when it comes down to this is now where can you put user interfaces in places that you couldn't put user interfaces before?
[00:02:33] When we're a web developer, we have to effectively put all of the controls for application directly into the user interface. We saw with the application menus in Firecell, we don't necessarily have to do that, right? We can put stuff in menus, we can assign stuff to hotkeys, right, we don't need to shove every button in the UI.
[00:02:49] We don't need a dedicated window for things, we can have applications that kind of run in the background. And are listening maybe if they're just a menubar they're the UI that we kind of even see all the time, right? And can do stuff, and can write to databases under the hood and stuff along those lines.
[00:03:02] Listen to the clipboard, so on and so forth, right? There's a lot of different opportunities to create applications that we don't normally think about when we're just thinking about that viewport in the browser.