Advanced Search
Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Previous Book Contents Book Index Next

Inside Macintosh: Operating System Utilities /
Chapter 1 - Gestalt Manager / Gestalt Manager Reference
Application-Defined Routines / The Selector Function


The selector function is responsible for placing the requested information in the response parameter and returning an appropriate error code.

FUNCTION MySelectorFunction (selector: OSType; 
                             VAR response: LongInt): OSErr;
The selector code that triggers the function.
On exit, the information.
The selector function places the requested information in the response parameter and returns a result code. If the information is not available, the selector function returns the appropriate error code, which Gestalt returns as its function result.

A selector function can call Gestalt or even other selector functions. It must reside in the system heap.

The registers on entry and exit for the selector function are
Registers on entry
D0Selector code
Registers on exit
D0Result code

noErr0No error
gestaltUnknownErr-5550Could not obtain the response
See "Adding a New Selector Code" beginning on page 1-10 for a sample selector function and a procedure that installs it in the system heap. For information about the NewGestalt function, see page 1-34. For information about the ReplaceGestalt function, see page 1-35.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996

Get information on Apple products.
Visit the Apple Store online or at retail locations.

Copyright © 2004 Apple Computer, Inc.
All rights reserved. | Terms of use | Privacy Notice