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 / Setting Up a Color Picker


MyInitPicker

Color picker-defined subroutine that handles a kInitPicker request.

If you create a color picker, it must respond to the kInitPicker request code. The Color Picker Manager sends this code to request your color picker to instantiate any private data it needs. A color picker responds to the kInitPicker request code by calling a color picker-defined subroutine (for example, MyInitPicker) to handle the request.

pascal ComponentResult MyInitPicker (
PickerStorageHndl storage, 
PickerInitData *data);
storage
A handle to your color picker's newly initialized global data.
data
A pointer to a PickerInitData structure (page 2-18), in which one or more color picker flags may be set. You may want your color picker to store this information in its global data.
DISCUSSION
Using the storage allocated in the storage parameter, your MyInitPicker function should initialize any private data needed by your color picker.

The Color Picker Manager uses the Component Manager to send the kInitPicker request code after your color picker has set up all of its external data. If the Color Picker Manager has opened your color picker only to obtain a list of color pickers for the More Choices list, your color picker will not receive this message unless it is actually chosen by the user.

Before handling the kInitPicker request code, your color picker must be able to handle the kTestGraphicsWorld request code, the kGetDialog request code, and the kGetItemList request code. These constants are described in "Request Codes" (page 2-12).

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

SEE ALSO
Listing 2-17 (page 2-34) 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