Important: The information in this document is obsolete and should not be used for new development.
MyInitPicker
Color picker-defined subroutine that handles akInitPicker
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 thekInitPicker
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 thestorage
parameter, yourMyInitPicker
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 thekTestGraphicsWorld
request code, thekGetDialog
request code, and thekGetItemList
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.