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
Gestalt Manager Routines / Adding a Selector Code


You can use the NewGestalt function to add a selector code to those already recognized by Gestalt.

FUNCTION NewGestalt (selector: OSType; 
                     gestaltFunction: SelectorFunctionUUP)
                     : OSErr;
The selector code you're adding, which is a four-character sequence of type OSType.
A pointer to the selector function that Gestalt executes when it receives the new selector code.
The NewGestalt function registers a specified selector code with the Gestalt Manager so that when Gestalt is called with that selector code, the specified selector function is executed. The function result of NewGestalt is a result code.

Before calling NewGestalt, you must define a selector function and install it in the system heap. The selector function must conform to the interface defined in "Adding a New Selector Code" beginning on page 1-10.

Registering with the Gestalt Manager is a way for software such as system extensions to make their presence known to potential users of their services.

The NewGestalt function might move memory and should not be called at interrupt time.

The registers on entry and exit for the NewGestalt function are
Registers on entry
A0Address of new selector function
D0Selector code
Registers on exit
D0Result code

noErr0No error
memFullErr-108Ran out of memory
gestaltDupSelectorErr-5552Selector already exists
gestaltLocationErr-5553Function not in system heap
See "Adding a New Selector Code" beginning on page 1-10 for a sample selector function and a sample procedure that installs it. For information about the Gestalt function, see page 1-31.

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