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: More Macintosh Toolbox /
Chapter 5 - Icon Utilities / Icon Utilities Reference
Icon Utilities Routines / Performing Operations on Icons in an Icon Suite


ForEachIconDo

You can use the ForEachIconDo function to perform an action on one or more icons in an icon suite.

FUNCTION ForEachIconDo (theSuite: Handle; 
                        selector: IconSelectorValue;
                        action: IconAction; 
                        yourDataPtr: Ptr): OSErr;
theSuite
A handle to an icon suite.
selector
A long integer whose bits determine which icons in the suite to perform the operation on. See the description that follows for a list of constants you can use in this parameter.
action
A pointer to your icon action function.
yourDataPtr

A pointer to data that is passed to your icon action function.
DESCRIPTION
The ForEachIconDo function uses the icon action function identified by the action parameter to perform an action on the specified icons in the icon suite. You can use these constants in the selector parameter to specify the icons on which to perform the action:

CONST
   svLarge1Bit       = $00000001; {'ICN#' resource}
   svLarge4Bit       = $00000002; {'icl4' resource}
   svLarge8Bit       = $00000004; {'icl8' resource}
   svSmall1Bit       = $00000100; {'ics#' resource}
   svSmall4Bit       = $00000200; {'ics4' resource}
   svSmall8Bit       = $00000400; {'ics8' resource}
   svMini1Bit        = $00010000; {'icm#' resource}
   svMini4Bit        = $00020000; {'icm4' resource}
   svMini8Bit        = $00040000; {'icm8' resource}
   svAllLargeData    = $000000FF; {'ICN#', 'icl4', and 'icl8' }
                                  { resources}
   svAllSmallData    = $0000FF00; {'ics#', 'ics4', and 'ics8' }
                                  { resources}
   svAllMiniData     = $00FF0000; {'icm#', 'icm4', and 'icm8' }
                                  { resources}
   svAll1BitData     = (svLarge1Bit + svSmall1Bit + svMini1Bit);
   svAll4BitData     = (svLarge4Bit + svSmall4Bit + svMini4Bit);
   svAll8BitData     = (svLarge8Bit + svSmall8Bit + svMini8Bit);
   svAllAvailableData= $FFFFFFFF; {all resources of given ID}
These constants are additive; that is, you can add several constants to include the corresponding family members in the icon suite.

You can use the yourDataPtr parameter to pass a pointer to data or other information required by your icon action function. Typically, you use this parameter to specify which action your icon action function should perform.

ForEachIconDo calls your icon action function once for each type of icon specified in the selector parameter. ForEachIconDo passes to your icon action function a handle to the icon to perform the action on. Your icon action function should perform any action as indicated by the yourDataPtr parameter and return a result code. ForEachIconDo returns the result code returned by your icon action function. If your icon action
function returns a nonzero function result, ForEachIconDo immediately returns to the application.

RESULT CODE
noErr0No error
SEE ALSO
See "Icon Action Functions" beginning on page 5-57 for more information about icon action functions.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996