Getting Started with Carbon

Technology Overview

Carbon is a procedural C interface for Mac OS X. Whether you are writing a new application or porting one from another platform, Carbon is an excellent framework for developing on Mac OS X. If you're developing new applications and prefer an object-oriented interface, be sure to consider Cocoa.

If you are familiar with C programming but not with Carbon or Mac OS X, you want to learn how to design and implement a basic user interface and then learn how to build a Carbon application using Mac OS X development tools. After that, you’ll want to explore the various Carbon "managers" and "services" for APIs specific to your needs.

Start Here

Before you begin development, you should familiarize yourself with the system architecture and user interface of Mac OS X. You should read:

  • Mac OS X Technology Overview to learn about the major application environments available (Carbon, Cocoa, and Java).

  • Carbon Overview to familiarize yourself with the Carbon technologies available for application development.

  • Apple Human Interface Guidelines to learn what standard user interface elements are available in Mac OS X and to understand how to design your application's look and feel.

Choose a Learning Path

If you’re just beginning to develop Carbon applications, you may want to know how developing for Mac OS X differs from developing for other platforms. If you’re ready to develop for Mac OS X, you’ll want to learn how to use the Xcode development environment. If you’re familiar with Xcode, you’ll want to begin creating a simple user interface for Mac OS X.

Migrating from Another Platform

Before you begin development for Mac OS X, you may need to move your existing code from another platform.

Developing with Xcode

To develop Carbon applications, Apple recommends using Xcode, which is included in the Developer Tools package included with Mac OS X v10.3 (Panther) and later. You should read:

  • Xcode 2.1 User Guide to learn about the tools used to design a user interface as well as build and debug applications.

  • Xcode Quick Tour for Mac OS X to learn how to use Xcode tools to build a simple Carbon application.

Once you’re familiar with Xcode, you’re ready to build a user interface for a Carbon application.

Building a User Interface

To build a user interface for your Carbon application, you should read:

  • Carbon Event Manager Programming Guide to understand the event-handling model for Carbon applications. Carbon events are the primary messaging mechanism between your application and system software, handling user interactions as well as low-level events.

  • Handling Carbon Windows and Controls to learn how to create and manipulate windows and controls in Carbon applications.

  • Creating Carbon Menus to learn how to implement menus in your Carbon application.

  • HIView Programming Guide to familiarize yourself with the object-oriented approach to implementing Carbon user interface objects. If you are planning to run your application on Mac OS X v10.2 (Jaguar) or later, you should adopt HIViews.

  • Unarchiving Interface Objects With Interface Builder Services to learn how to access Carbon user interface elements created using the Interface Builder tool, included with Xcode. Although you can create windows, controls, and menus programmatically, in most cases the preferred method is to create them in Interface Builder and store them as special "nib" files.

  • Learning Carbon from O'Reilly & Associates, which provides a book-length tutorial for building Carbon applications, including topics such as building the user interface, manipulating text, and printing. Even though this book uses an older development environment (Project Builder), much of the information is still useful for developers wanting to learn about Carbon.

Note that the Carbon user interface APIs are often referred to as the Human Interface Toolbox, High Level Toolbox, or, if you are using object-oriented HIViews, the HIToolbox.

Next Steps

The Carbon Reference Library includes the following high-level Carbon resource pages, which you can bookmark for easy access:

  • Guides

    Conceptual and how-to information about Carbon technologies.

  • Reference

    Focused, detailed descriptions in reference format for Carbon.

  • Release Notes

    Late-breaking news about new or changed features in the Carbon API.

  • Sample Code

    Sample applications demonstrating a wide variety of Carbon technologies. If you have installed the developer tools or Xcode CD, you may also want to check out the sample applications in Developer/Examples/Carbon.

  • Technical Notes

    Late-breaking documents on Carbon-related issues.

  • Technical Q&As

    Programming tips, code samples, and FAQs by Apple’s support engineers.

  • Mailing Lists

    The Carbon development mailing list (carbon-dev) is an excellent place to discuss programming issues or topics with fellow Carbon developers.

These additional resource pages may also be helpful:

  • Tips and Tricks

    A site containing useful information for developing, porting, and debugging Carbon applications.



© 2003, 2006 Apple Computer, Inc. All Rights Reserved. (Last updated: 2006-05-23)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.