Documentation Archive Developer
Search

ADC Home > Reference Library > Technical Q&As > Carbon > Human Interface Toolbox >

Enabling the application menu's "Preferences..." menu item on Mac OS X


Q: How do I enable the application menu's "Preferences..." menu item on Mac OS X?

A: For the "Preferences..." menu item to be enabled, 2 conditions must be met:

1) the menu item must be enabled using the following statement:

EnableMenuCommand(NULL, kHICommandPreferences);

and

2) a Carbon event handler must be provided for the kHICommandPreferences command ID or, if you do not handle Carbon events, an AppleEvent handler must be provided for the pair kCoreEventClass / kAEShowPreferences.

If you do not meet with the second condition, then the "Preferences..." menu item will be enabled but nothing will happen when the users selects it.

If your Carbon application was also designed for Mac OS 8 and/or 9, and thus already had a "Preferences..." menu item somewhere in your menu resources, you must also remember to delete this menu item (and any associated divider line) when running on Mac OS X so that the user is not confused by two "Preferences..." menu items.


[Oct 30 2001]