Carbon


PickerItemHitProcPtr

Header: ColorPickerComponents.h Carbon status: Supported

Defines a pointer to a color picker-defined item event handler callback function. Your item event handler function responds to an event in one of your color picker’s items.

typedef ComponentResult(* PickerItemHitProcPtr) (
    SInt32 storage, 
    PickerItemHitData *data
);

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

ComponentResult MyPickerItemHitCallback (
    SInt32 storage, 
    PickerItemHitData *data
);
Parameter descriptions
storage

A handle to your color picker’s global data.

data

A pointer to an ItemHitData structure.Your MyPickerItemHitCallback function should respond to the event for the item reported in the itemHit field of the ItemHitData structure. This item is passed by the Dialog Manager function DialogSelect.The iMod field informs your function of the action in the item. These actions are represented by the “Item Hit Modifiers” constants.

Your MyPickerItemHitCallback function returns information about any event handling it performs in this parameter. Your function should set the action field to the particular action it performed. The colorProc field may contain a pointer to your ColorChangedProcPtr, which should support the updating of colors in a document as the user selects them. Your color picker should call this function.

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 kItemHit request code, by calling a color picker-defined subroutine (MyPickerItemHitCallback, 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.


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