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
Standard File Package Routines / Opening Files


SFGetFile

Use the SFGetFile procedure to display the default Open dialog box when the user is opening a file.

PROCEDURE SFGetFile (where: Point; prompt: Str255;
                     fileFilter: FileFilterProcPtr;
                     numTypes: Integer; typeList: SFTypeList;
                     dlgHook: DlgHookProcPtr; VAR reply: SFReply);
where
The upper-left corner of the dialog box, in global coordinates.
prompt
Ignored.
fileFilter
A pointer to an optional file filter function, provided by your application, through which SFGetFile passes files of the specified types.
numTypes
The number of file types to be displayed. If you specify a numTypes value of -1, the first filtering passes files of all types.
typeList
A list of file types to be displayed.
dlgHook
A pointer to your dialog hook function, which handles item selections received from the Dialog Manager. Specify a value of NIL if you want the standard items handled in the standard ways.
reply
The reply record, which SFGetFile fills in before returning.
DESCRIPTION
The SFGetFile procedure displays a dialog box listing the names of a specific
group of files from which the user can select one to be opened (as during an Open
menu command). During the dialog, SFGetFile gets and handles events (possibly
with the assistance of application-defined callback routines) until the user completes
the interaction, either by selecting a file to open or by canceling the open operation. SFGetFile returns the user's input in a record of type SFReply.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for SFGetFile are
Trap macroSelector
_Pack3$0002

SPECIAL CONSIDERATIONS
Because SFGetFile may move memory, you should not call it at interrupt time.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996