Carbon


PickerInitProcPtr

Header: ColorPickerComponents.h Carbon status: Supported

Defines a pointer to a color picker-defined initialization callback function. Your color picker initialization callback function instantiates and initializes any private data needed by your color picker.

typedef ComponentResult(* PickerInitProcPtr) (
    SInt32 storage, 
    PickerInitData *data
);

You would declare your function like this if you were to name it MyPickerInitCallback:

ComponentResult MyPickerInitCallback (
    SInt32 storage, 
    PickerInitData *data
);
Parameter descriptions
storage

A handle to your color picker’s newly initialized global data.

data

A pointer to a PickerInitData structure, 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.

function result

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

DISCUSSION

If you create a color picker, it must respond to the kInitPicker request code, by calling a color picker-defined subroutine (MyPickerInitCallback, for example).

When you create a color picker, the Color Picker Manager uses the Component Manager to request services from your color picker. The code for your color picker should be contained in a resource. The Component Manager expects that the entry point into this resource is a color picker-defined dispatch function. For information on how to create this dispatch function, see the Component Manager callback, ComponentRoutineProcPtr.

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, kGetDialog, and kGetItemList request codes (described in PickerTestGraphicsWorldProcPtr, PickerGetDialogProcPtr, and PickerGetItemListProcPtr, respectively).


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)