CheckItem
CheckItem Place/remove a check mark to left of menu item
#include <Menus.h> Menu Manager
void CheckItem(theMenu, whichItem, checkIt );
MenuHandle theMenu ; handle of menu with item to check/uncheck
short whichItem ; item ID of item to check/uncheck
Boolean checkIt ; TRUE=check it; FALSE=remove check mark
CheckItem places or removes a check mark (ASCII 18, ") to the left of a
specified menu item. This is used to indicate which of several menu options
are currently in effect; e.g., that character style is being used.
theMenu is a handle leading to a variable-length MenuInfo structure. It is a
value obtained via NewMenu or GetMenu. It identifies the menu
containing the item to check or uncheck.
whichItem identifies that item in menu theMenu to check or uncheck. Items
are numbered sequentially with the topmost item having an ID of 1.
checkIt is a Boolean value specifying whether to place a check mark or
remove the check mark (or any type of mark). It must be one of:
FALSE Remove existing mark (any type of mark)
TRUE Place a standard check mark () to left of item
Returns: none

Notes: This is the easy way to handle the normal "Yes or No" type of check mark
displayed next to menu items. It is typically used to let the user select from
among several mutually-compatible options, such as character formatting
styles.
You may specify that the item be checked initially by using the !
metacharacter when you insert the item text; e.g.:
AppendMenu( theMenu, "\p!\022Plain Text" ); /* Plain Text */
You can also call SetItemMark to use any other character in the system
font (Chicago 12-pt). In any case, you may use CheckItem( ..., FALSE) to
remove the mark.
Use GetItemMark to determine if there is currently a check mark (or
any other mark) associated with the menu item.
On hierarchical menus, the mark character, when applied to an item whose
command key is 0x1b, is used to identify the menu ID for a submenu. See
Example
#include <Menus.h>
#include <Quickdraw.h> Ï/* get named- constants for styles */
long mSelResult;
short curStyle;
mSelResult = MenuSelect( theEvent.where ); /* user selects */
if ( HiWord( mSelResult)==STYLE_MENUID) ) { /* in "Styles" menu? */
switch ( LoWord( mSelResult ) ) {
case PLAIN_ID:
CheckItem( styleMenu, PLAIN_ID, TRUE );
CheckItem( styleMenu, ITAL_ID, FALSE );
CheckItem( styleMenu, BOLD_ID, FALSE );
CheckItem( styleMenu, UL_ID, FALSE );
curStyle = 0; /* normal text */
break;
case ITAL_ID:
CheckItem( styleMenu, PLAIN_ID, FALSE );
CheckItem( styleMenu, ITAL_ID, TRUE );
curStyle |= italic;
break;
/* ... etc. ... */
}
}