Carbon


PickerSetColorProcPtr

Header: ColorPickerComponents.h Carbon status: Supported

Defines a pointer to a color picker-defined color setter callback function. Your color setter callback function sets an original or a new color.

typedef ComponentResult(* PickerSetColorProcPtr) (
    SInt32 storage, 
    PickerColorType whichColor, 
    PMColorPtr color
);

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

ComponentResult MyPickerSetColorCallback (
    SInt32 storage, 
    PickerColorType whichColor, 
    PMColorPtr color
);
Parameter descriptions
storage

A handle to your color picker’s global data.

whichColor

A type of color—specified by either the kOriginalColor or kNewColor constant—which your color picker should set. If this value is kOriginalColor, your function should set the color that the user begins to edit. If this value is kNewColor, your function should set the color to be used as if it were the last color selected by the user.

color

A pointer to a PMColor structure. Your function should set the original or new color to the color specified in this parameter.

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 kSetColor request code, by calling a color picker-defined subroutine (MyPickerSetColorCallback, 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)