Chapter 9. Creating application and context menus
This chapter covers
- Creating application window menus
- Handling Mac OS’s approach to menus
- Handing Windows’s/Linux’s approach to menus
- Creating context menus for the content inside of the application
Menus are important for providing users with lots of feature choices. Anyone familiar with using Microsoft Office will know how much functionality is available to users from the app menu when using Word or Excel. It’s one of the most effective UI patterns in widespread use today.
In this chapter, we’ll look at how to create app menus for your desktop apps. You’ll see how they’re handled differently by Mac OS compared to Windows and Linux. We’ll then look at context menus, which provide the user with options when right-clicking on elements within the app, such as being able to insert an item of content at a particular point within a document.
Three kinds of menus are available for your Node.js desktop apps: app window menus, context menus, and tray menus (covered in chapter 8). App window menus appear in the top of an app window under the title bar (or in the system menu on Mac OS), and you see context menus when right-clicking an item in the app. We’ll take a look at app window menus first.
Creating an app menu bar is a bit tricky, and you must consider which OSs you’re targeting.