Important: The information in this document is obsolete and should not be used for new development.
InsertResMenu
Use theInsertResMenu
procedure to search all resource files open to your application for a given resource type and to insert the names of any resources it finds to a specified menu. The items are inserted after the specified menu item. The specified menu must have been previously created usingNewMenu
,GetMenu
, orGetNewMBar
.
PROCEDURE InsertResMenu (theMenu: MenuHandle; theType: ResType; afterItem: Integer);
theMenu
- A handle to the menu record of the menu to which to add the names of any resources of a given type that
InsertResMenu
finds.theType
- A four-character code that identifies the resource type for which to search.
afterItem
- A number that indicates where in the menu to insert the names of any resources of the given type that
InsertResMenu
finds. Specify 0 in theafterItem
parameter to insert the items before the first menu item; specify the item number of a menu item already in the menu to insert the items after the specified item number. If you specify a number greater than or equal to the last item in the menu, the items are inserted at the end of the menu.DESCRIPTION
TheInsertResMenu
procedure searches all resource files open to your application for resources of the type defined by the parametertheType
. It inserts the names of any resources it finds of the given type at the specified location in the specified menu.InsertResMenu
adds the names of found resources in alphabetical order; it does not alphabetize items already in the menu.The
InsertResMenu
procedure does not add resources with names that begin with a period (.
) or a percent sign (%
) to the menu.The
InsertResMenu
procedure assigns default characteristics to each menu item. Each appended menu item appears in the menu as an enabled item, without an icon or a mark, in the plain character style, and without a keyboard equivalent. To get the name or to change other characteristics of an item appended byInsertResMenu
, use the Menu Manager routines described in the next section, "Getting and Setting the Appearance of Menu Items."If you specify that
InsertResMenu
add resources of type'DRVR' to your Apple menu, InsertResMenu adds the name (and icon) of each item in the Apple Menu Items folder to the menu.
If you specify that
InsertResMenu
add resources of type'FONT'
or'FOND',
the Menu Manager performs special processing for any resources it finds that have font numbers greater than $4000. If the script associated with the font name is currently active,InsertResMenu
stores information in theitemDefinitions
array (in theitemIcon
anditemCmd
fields for that item) in the menu's menu record that allows the Menu Manager to display the font name in the correct script.SPECIAL CONSIDERATIONS
TheInsertResMenu
procedure calls the Resource Manager procedureSetResLoad
(specifyingTRUE
in theload
parameter) before returning. TheInsertResMenu
procedure reads the resource data of the resources it finds into memory. If your application does not want the Resource Manager to read resource data into memory when your application calls other routines that read resources, you need to callSetResLoad
and specifyFALSE
in theload
parameter afterInsertResMenu
returns.