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 / Dialog Hook Functions


MyDlgHook

A dialog hook function should have the following form:

FUNCTION MyDlgHook (item: Integer; theDialog: DialogPtr;
                     myDataPtr: Ptr): Integer;
item
The number of the item selected.
theDialog
A pointer to the dialog record of the dialog box.
myDataPtr
A pointer to the optional data whose address is passed to CustomGetFile or CustomPutFile.
DESCRIPTION
You supply a dialog hook function to handle user selections of items that you added
to a dialog box. If you provide a dialog hook function, CustomPutFile and CustomGetFile call your function immediately after calling ModalDialog. They
pass your function the item number returned by ModalDialog, a pointer to the
dialog record, and a pointer to the data received from your application, if any.

Your dialog hook function returns as its function result an integer that is either the item number passed to it or some other item number. If your dialog hook function does not handle a selection, it should pass the item number back to the Standard File Package for processing by setting its return value equal to the item number. If your dialog hook function does handle the selection, it should pass back sfHookNullEvent or the number of some other pseudo-item.

SEE ALSO
See "Writing a Dialog Hook Function" on page 3-21 for a sample dialog hook function.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996