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 / Menu Manager Reference
Menu Manager Routines / Getting and Setting the Appearance of Menu Items


SetMenuItemText

Use the SetMenuItemText procedure to set the text of a specific menu item to a given string. The SetMenuItemText procedure is also available as the SetItem procedure.

PROCEDURE SetMenuItemText (theMenu: MenuHandle; item: Integer;
                           itemString: Str255); 
theMenu
A handle to the menu record of the menu containing the menu item whose text you wish you to set.
item
The item number of the menu item. The SetMenuItemText procedure sets the text of this item.
itemString
The SetMenuItemText procedure sets the text of the menu item according to the string specified in the itemString parameter. The SetMenuItemText procedure does not recognize metacharacters or set any other characteristics of the menu item. The itemString parameter can be blank, but it should not be an empty string.
DESCRIPTION
The SetMenuItemText procedure sets the text of the specified menu item to the text specified in the itemString parameter. The SetMenuItemText procedure does not recognize any metacharacters used by the AppendMenu and InsertMenuItem procedures. Use other Menu Manager routines to set other characteristics of a menu item.

If you set the text of a menu item using the SetMenuItemText procedure, you should store the text in a string resource so that your application can be more easily localized.

SEE ALSO
See Listing 3-9 on page 3-59 for an example of setting the text of a menu item.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996