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: Files /
Chapter 3 - Standard File Package / Standard File Package Reference
Application-Defined Routines / Modal-Dialog Filter Functions


MyModalFilterYD

A modal-dialog filter function whose address is passed to CustomGetFile or CustomPutFile should have the following form:

FUNCTION MyModalFilterYD (theDialog: DialogPtr; 
                           VAR theEvent: EventRecord; 
                           VAR itemHit: Integer; 
                           myDataPtr: Ptr): Boolean;
theDialog
A pointer to the dialog record of the dialog box.
theEvent
The event record for the event.
itemHit
The number of the item selected.
myDataPtr
A pointer to the optional data whose address is passed to CustomGetFile or CustomPutFile.
DESCRIPTION
Your modal-dialog filter function determines how the Dialog Manager procedure ModalDialog filters events. The ModalDialog procedure retrieves events by calling the Event Manager function GetNextEvent. The Standard File Package contains an internal filter function that performs some preliminary processing on each event it receives. If you provide a modal-dialog filter function, ModalDialog calls your filter function after it calls the internal Standard File Package filter function and before it sends the event to your dialog hook function.

Your modal-dialog filter function returns a Boolean value that reports whether it handled the event. If your function returns a value of FALSE, ModalDialog processes the event through its own filters. If your function returns a value of TRUE, ModalDialog returns with no further action.

SEE ALSO
See "Writing a Modal-Dialog Filter Function" on page 3-28 for a sample modal-dialog filter function.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996