Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Advanced Color Imaging Reference /
Chapter 2 - Color Picker Manager Reference /
Color Picker-Defined Functions / Responding to Events in a Color Picker


MyDoEdit

Color picker-defined subroutine that handles a kEdit request.

If you create a color picker, it must respond to the kEdit request code. The Color Picker Manager sends this code to inform your color picker that the user has chosen one of the edit commands from the Edit menu (or the user has typed a Command-key equivalent). A color picker responds to the kEdit request code by calling a color picker-defined subroutine (for example, MyDoEdit) to handle the request.

pascal ComponentResult MyDoEdit (
PickerStorageHndl storage, 
EditData *data);
storage
A handle to your color picker's global data.
data
A pointer to an EditData structure (page 2-29).
DISCUSSION
If your color picker needs to handle an editing command instead of allowing the Dialog Manager to handle it, your MyDoEdit function should perform it. For example, because the Dialog Manager does not handle the Undo command, your MyDoEdit function can handle it instead. The editing command is passed to your function in the field theEdit of the EditData structure pointed to in the data parameter.

If your function handles the command, it should set the handled field of the EditData structure to true, in which case the Dialog Manager performs no additional processing of the associated event. If your function sets the handled field to false, then the Color Picker Manager sends your color picker the kItemHit request code with the appropriate information regarding the event in the editable-text item.

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

SEE ALSO
Listing 2-23 (page 2-40) in Advanced Color Imaging on the Mac OS illustrates how to implement this function.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 NOV 1996