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: Advanced Color Imaging Reference /
Chapter 2 - Color Picker Manager Reference /
Application-Defined Functions / Changing Colors in a Document


MyColorChangedFunction

Application-defined function that handles color changes.

Your application can supply the colorProc field of the color picker parameter block with a pointer to the application-defined function. Your function should take two parameters--one for data previously specified by your application, and another specifying the new color selected by the user. For example, this is how you would declare it if you were to name it MyColorChangedFunction.

pascal void MyColorChangedFunction (
long userData, 
PMColorPtr newColor);
userData
Data that your application supplies in the colorProcData field of the color picker parameter block (page 2-20). Your application can use this value for any purpose it needs.
newColor
A pointer to a PMColor structure (page 2-15) that contains the new color selected by the user.
DISCUSSION
Your color-changed function should update the user's document to use the color specified in the newColor parameter.

SEE ALSO
Listing 2-3 (page 2-9) in Advanced Color Imaging on the Mac OS provides an example of a color-changed function.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 NOV 1996