O'Reilly logo

Beginning Mac OS® X Programming by Drew McCormack, Michael Trent

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

4.2. Building Menus

Every Mac OS X program has a main menu bar—that familiar sight at the top of your computer's screen. Although every application adds its own menus and menu items, there is a fair amount of similarity between each program. Most programs have File, Edit, Window, and Help menus, for example. The guidelines for how menus should look and behave can be found in the Apple Human Interface Guidelines, which you learned about in Chapter 2.

In this Try It Out example, you create a menu bar for a Carbon application. Interface Builder provides some nice graphical tools for building menus, and it also sets up many of the common menus for you.

4.2.1.

4.2.1.1. Try It Out: Building Carbon Menus
  1. In Interface Builder, create a new Carbon Menu Bar project. Note that you can open the Starting Point window by choosing FileNew, if necessary. Three windows appear: your untitled interface window, the Palettes window, and a window representing your nib's menu bar.

  2. Click once on the File menu in your menu bar window. The File menu drops down, as shown in Figure 4-5. Notice that a bunch of items have already been filled in for you.

    Figure 4.5. Figure 4-5
  3. Click once on the New item your nib's File menu. The New menu item will be selected.

  4. Choose ToolsShow Inspector to open the Inspector. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required