Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Macintosh Toolbox Essentials /
Chapter 3 - Menu Manager / Introduction to Menus


The Menu Bar

Each application has its own menu bar. The menu bar of an application applies to only that application. You usually define a menu bar for your application by providing a menu bar ('MBAR') resource that lists the order and resource ID of each menu that appears in your menu bar. You define the menu title and the individual characteristics of menu items that appear in a menu by providing a menu ('MENU') resource for each menu that appears in your menu bar. You use Menu Manager routines to create the menus and menu bar based on these resource definitions.

Your application can change the enabled state of a menu, add menus to or remove menus from its menu bar, or change the characteristics of any menu items. Whenever your application changes the enabled state of a menu or the number of menus in its menu bar, your application must call the DrawMenuBar procedure to update the menu bar's appearance.

The menu bar (as defined by the standard menu bar definition function) is white, with a height that is tall enough to display menu titles in the height of the system font and system font size, and with a black lower border that is one pixel tall. The menu bar is as wide as the screen and always appears on the monitor designated by the user as the startup screen. (The user selects a startup screen using the Monitors control panel.) The menu bar appears at the top of the screen, and nothing except the cursor can appear in front of it. Figure 3-3 shows the menu bar of the SurfWriter application.

Figure 3-3 The menu bar of the SurfWriter application

The menu bar helps to indicate the active application. The active application is the one whose menu bar is currently showing and whose icon appears as the menu title of the Application menu.

The titles of menus appear in the menu bar. A menu title is a text string (except for the Apple, Help, Keyboard, and Application menus, the titles of which contain a small icon). Menu titles always appear in the system font and system font size (for Roman scripts, the system font is Chicago and the system font size is 12).

You can insert any number of menu titles in the menu bar; however, less than 10 is usually optimum. Keep in mind that not all users have the same size monitor. Design your menu bar so that all titles can fit in the menu bar of the smallest screen on which your application can run. You should also consider localization issues when designing the number of menus that fit in your menu bar--not all menu titles might fit in the menu bar once the menu titles are translated. For example, English text often grows 50 percent larger when translated to other languages.

Figure 3-4 shows the SurfWriter application's menu bar with menu titles that have been localized for another script system.

Figure 3-4 The SurfWriter application's menu bar localized for another script system


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996