If you develop your software using Carbon, there are several things you can do to make your programs work better in Mac OS X. The following sections list migration tips and recommendations for technologies you should be using.
Migrating From Mac OS 9
Use the Carbon Event Manager
Use the HIToolbox
Use Nib Files
If you were a Mac OS 9 developer, the Carbon interfaces should seem very familiar. However, improvements in Carbon have rendered many older technologies obsolete. The sections that follow list both the required and the recommended replacement technologies you should use instead.
The technologies listed in Table 8-1 cannot be used in Carbon. You must use the technology in the “Now use” column instead.
Instead of | Now use |
|---|---|
Any device manager | I/O Kit |
Apple Help | |
BSD sockets or CFNetwork | |
Carbon Help Manager | |
Apple events | |
Core Printing Manager | |
OpenGL | |
Quartz and Apple Type Services for Unicode Imaging (ATSUI) | |
Navigation Services | |
Time Manager |
The technologies listed in Table 8-2 can still be used in Carbon, but the indicated replacements provide more robust support and are preferred.
Instead of | Now use |
|---|---|
Quartz Services | |
Carbon Event Manager | |
Apple Type Services for Fonts | |
Launch Services and System Configuration | |
BSD sockets or CFNetwork | |
Quartz 2D | |
Core Text | |
Interface Builder Services | |
Unicode Utilities | |
Multilingual Text Engine | |
CFNetwork |
Use of the Carbon Event Manager is strongly recommended for new and existing Carbon applications. The Carbon Event Manager provides a more robust way to handle events than the older Event Manager interfaces. For example, the Carbon Event Manager uses callback routines to notify your application when an event arrives. This mechanism improves performance and offers better mobility support by eliminating the need to poll for events.
For an overview of how to use the Carbon Event Manager, see Carbon Event Manager Programming Guide.
The Human Interface Toolbox is the technology of choice for implementing user interfaces with Carbon. The HIToolbox extends the Macintosh Toolbox and offers an object-oriented approach to organizing the content of your application windows. This new approach to user interface programming is the future direction for Carbon and is where new development and improvements are being made. If you are currently using the Control Manager and Window Manager, you should consider adopting the HIToolbox.
Note: The HIToolbox interfaces are available for creating 32-bit applications only. If you are creating 64-bit applications, you should use Cocoa for your user interface instead.
For an overview of HIView and other HIToolbox objects, see the documents in Reference Library > Carbon > Human Interface Toolbox.
Nib files, which you create with Interface Builder, are the best way to design your application interface. The design and layout features of Interface Builder will help you create Aqua-compliant windows and menus. Even if you do not plan to load the nib file itself, you can still use the metrics from this file in your application code.
For information about using Interface Builder, see Interface Builder User Guide.
Last updated: 2007-10-31