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 /
Color Picker-Defined Functions / Responding to Requests to Return and Set Color Picker Information


MySetColor

Color picker-defined subroutine that handles a kSetColor request.

If you create a color picker, it must respond to the kSetColor request code. The Color Picker Manager sends this code to request your color picker to set either the original or the new color. A color picker responds to the kSetColor request code by calling a color picker-defined subroutine (for example, MySetColor) to handle the request.

pascal ComponentResult MySetColor (
PickerStorageHndl storage, 
ColorType whichColor, 
PMColorPtr color);
storage
A handle to your color picker's global data.
whichColor
A type of color--either original or new--which your color picker should set. Your function should respond to the value represented by either the kOriginalColor or kNewColor constant.
color
A pointer to a PMColor structure (page 2-15).
DISCUSSION
Your MySetColor function should set an original or a new color to that specified in the color parameter. If your MySetColor function is passed the value represented by the kOriginalColor constant, it should set the color that the user begins to edit. If your MyGetColor function is passed the value represented by the kNewColor constant, it should set the color to be used as if it were the last color selected by the user.

Your function should return noErr if successful, or an appropriate result code otherwise.

SEE ALSO
Listing 2-25 (page 2-41) in Advanced Color Imaging on the Mac OS illustrates how to implement this function.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 NOV 1996