Important: The information in this document is obsolete and should not be used for new development.
Using the Component Manager
This section describes how you can use the Component Manager to
The Component Manager is available in System 7.1 or later and may be present in System 7. To determine whether the Component Manager is available, call the
- gain access to components
- locate components and take advantage of their services
- get information about a component
- close a connection to a component
Gestalt
function with thegestaltComponentMgr
selector and check the value of theresponse
parameter.
CONST gestaltComponentMgr = 'cpnt';TheGestalt
function returns in theresponse
parameter a 32-bit value indicating the version of the Component Manager that is installed. Version 3 and above supports automatic version control, the unregister request, and icon families. You should test the version number before using any of these features.This section presents several examples demonstrating how to use components and the Component Manager. All of these examples use the services of a drawing component--a simple component that draws an object of a particular shape on the screen. Drawing components have a component type of
'draw'
. The component subtype value indicates the type of object the component draws. For example, a drawing component that draws an oval has a component subtype of'oval'
. For information on creating your own components and for listings that show the code for a drawing component, see "Creating Components" beginning on page 6-12.
Subtopics
- Opening Connections to Components
- Getting Information About a Component
- Using a Component
- Closing a Connection to a Component