Important: The information in this document is obsolete and should not be used for new development.
MyDoEvent
Color picker-defined subroutine that handles akEvent
request.If you create a color picker, it must respond to the
kEvent
request code. The Color Picker Manager sends this code so that your color picker can handle events that the Dialog Manager does not handle. A color picker responds to thekEvent
request code by calling a color picker-defined subroutine (for example,MyDoEvent
) to handle the request.
pascal ComponentResult MyDoEvent ( PickerStorageHndl storage, EventData *data);
storage
- A handle to your color picker's global data.
data
- A pointer to an
EventData
structure (page 2-26).DISCUSSION
If your color picker needs to perform any event processing in addition to or instead of that normally performed by the Dialog Manager, yourMyDoEvent
function should perform it. The event is passed to your function in the event record pointed to in theevent
field of theEventData
structure which, in turn, is pointed to in thedata
parameter.In the
EventData
structure pointed to in thedata
parameter, yourMyDoEvent
function returns information about any event handling it performs. If your function handles the event, it should set the value of thehandled
field totrue
, in which case the Dialog Manager performs no additional handling of the event. Your function should set theaction
field to the particular action it performed. ThecolorProc
field may point to an application-defined function that your color picker should call.Your function should return
noErr
if successful, or an appropriate result code otherwise.SEE ALSO
Listing 2-21 in Advanced Color Imaging on the Mac OS illustrates how to implement this function.