Home Page Icon
Home Page
Table of Contents for
Learning Carbon
Close
Learning Carbon
by Apple Computer Inc
Learning Carbon
Learning Carbon
Preface
Why Carbon?
Who Might Find This Book Helpful
What You Need
What’s Up Ahead
Side Trips and Terms
Code
The Environment Could Change
How to Contact Us
1. Introduction to Carbon
Carbon and Mac OS X
What’s in Carbon?
Building Carbon Applications
The Carbon Factory Tour
The Starter Kit
The Toolbox interfaces
Aqua
Behind the curtain
The Expansion Pack
Specialty Interfaces
QuickTime
Color, images, and print production
3D graphics
HTML
Speech
Text and international services
Internet and networking
Security
Low-level tweaking
Utility Interfaces
Legacy Interfaces
Recap
2. Specifying a Carbon Application: Moon Travel Planner
The Moon Travel Planner Window
Behavior
Implementation
The Menu Bar
Behavior
Implementation
The About Window
Behavior
Implementation
The Facts for the Traveler Window
Behavior
Implementation
The Itinerary Window
Behavior
Implementation
Recap
3. Project Builder Projects
A Carbon Application Project
File References
Sources
Resources
External frameworks and libraries
Products
Targets
Main.c: A Skeletal Application
Things May Not Be Where You Think They Are
Application Bundles
Building and Running a Project
Debugging a Project
Onscreen Documentation
Moon Travel Planner: Creating a Project
Building and Running the Skeletal Application
Recap
4. Interface Builder: Nibs and Windows
A Carbon Nib File
The Default Items in a Nib File
Info Windows
Window Classes
Theme Brush
Controls
Attributes
Receives
Moon Travel Planner: Modifying the Default Window
Open Interface Builder
Revise the Window Title
Set the Window Class, Controls, and Attributes
Set the Window’s Size
Build, Run, and Check the Application
Recap
5. Interface Builder: Toolsand Controls
Palettes and Layout Tools
The Carbon Palettes Window
Menus palette
Controls palette
Enhanced controls palette
Data views palette
Windows palette
Layout Tools
Moon Travel Planner: Adding Objectsto the Main Window
Open the Nib File
Add an Item from the Enhanced Controls Palette
Add Items from the Controls Palette
Add a PICT Resource
Align Objects with the Layout Tools
Check the Interface
Recap
6. Carbon Events
Carbon Event Handling
Event Targets
Event Types
Event References
Default Event Handlers
Defining an Event Handler
Installing an Event Handler
MoonTravel Planner: Writing an Event Handler
Identify Events
Write the Main Window Event Handler
The main window event handler
The compute command handler
Install the Main Window Event Handler
Modify the main function
Call the Application Event Loop Function
Recap
7. Interface Builder: Menus
The Menu Bar
Application Menu
File Menu
Edit Menu
Window Menu
Help Menu
Hierarchical Menus
Contextual Menus
Moon Travel Planner: Modifying the Menu Bar
Disable the Items You Won’t Need
Set Up the Items You Know You’ll Need
Add an About command
Add an Open Itinerary command
Add Commands for Close and Save As
Add Commands for Page Setup and Print
Delete the Help Menu
Add an Application-Specific Menu to the Menu Bar
Add Code to Your Project
Create the menu bar
Handle menu commands
Test the Menus
Recap
8. Text and Localization
Language-Specific Folders
InfoPlist.strings File
Help Folder
Nib Files
Localizable Strings Files
Moon Travel Planner: Displaying Localized Text
Create a New Window
Add a Text Field
Create Content for the Window
Write a Function to Display the Window
Adding function and global declarations
Creating the window
Writing the show moon facts window function
Modify the Main Window Event Handler
Write a Handler for the Moon Facts Window
Identify events
Write the code for the handler
Install the moon facts window event handler
Make Sure the Text Displays Properly
Recap
9. Printing
The Carbon Printing Manager
A Sample Printing Session
A look at the print loop
Error handling
Sequence and Scope for Printing Functions
Data Types for Working with Printing Sessions
Functions for Working with Printing Sessions
Where to Go from Here
Moon Travel Planner: Adding Printing to the Moon Facts Window
Define Constants for Working with Printing
Define Data Types for Working with Printing
Define Prototypes for Printing Functions
Write Printing Functions
MTPCreatePrintInfoForWindow
MTPSetupPageFormatForPrinting
MTPPageSetupDoneProc
MTPDoPageSetup
MTPPrintDialogDoneProc
MTPDoPrint
MTPDrawMoonFactsPage
MTPPagesInDoc
MTPPostPrintingErrors
MTPDoPrintLoop
Add a Print Format String to the Localized Strings
Add Printing Code to the Main Function
Adjust Code in the Moon FactsWindow Event Handler
Test the Page Setup and Print Commands
Recap
10. Property Lists
The Information Property List: Info.plist
Standard Keys
Finder Keys
Viewing and Modifying Property Lists in Project Builder
The About Window
Moon Travel Planner: Modifying and Using Properties
Modify the Property List
Create a New Window
Create the About Window from the nib File
Write a Function to Handle the About Command
Writing an Event Handler for the About Window
Build, run, and test the application
Recap
11. Files
Managing Files on the Mac
The File Manager
Files
The organization of the file system
The Finder and the file system
The volume format
Identifying a file
File access
File size
The typical tasks of file management
Creating a new file
Opening a file
Reading and writing data
Navigation Services
The programming model
The navigation event handler
Persistence
The Navigation Services dialogs
Standard user interface elements in Navigation Services dialogs
The column view browser
The Where pop-up menu
Open dialog
Save Changes
Save Location
Moon Travel Planner: Handling Files
Create a Window to Display the Itinerary
Define Constants and Variables for Creating Itinerary Files
Write the Itinerary Window Event Handler
Open an Itinerary File
Configure and display an Open dialog
Respond to the user’s action
Retrieve the file to open
Create a new itinerary window
Read the itinerary file
Display the itinerary text
Save the Itinerary
Configure and display a Save dialog
Respond to the user’s action
Create the save file
Write the save data
Close the Itinerary
Handle the Open Command from the Main Window
Build, Run, and Test the Application
Recap
12. Providing Help
Help on Mac OS X
Help Content for Help Books
Guidelines for creating help content
The mechanics of creating help book content
Anchors
Segments
Descriptions
Keywords
Indexing
Help Tags
How does a help tag work?
Guidelines for writing help tags
Moon Travel Planner: Adding Help
Add the Help Book to the Project
Modify the Application’s Property List
Register the Help Book
Add a Help Tag
Make Sure Help Works Properly
Recap
13. Desktop Icons
Icon Basics
Types of Icons
Application icons
Document icons
Icons for plug-ins and other support files
Design Tips
Icon Sizes and Masks
Assigning Icons to Applications and Files
Importing icons into Icon Composer
Register the Icon Composer file for the application icon
Adding a Document Type to a Project
Generic file types
Custom file types
Moon Travel Planner: Adding Icons
Import Images to Icon Composer
Add the Icon Files
Register the Application Icon File
Add a Document Type
Make Sure the Icons Display in the Finder
Recap
14. Beyond Moon Travel: Advanced Topics
Scriptable Applications
How Scripting Works
Making Your Application Scriptable
Design scripting in from the beginning
Identify the objects and commands you will support
Create an ‘aete’ resource that describes your scripting support
Write handlers for the Apple events you support
Install your Apple event handlers
Process incoming Apple events
Threads and Multiprocessing
Multiprocessing Services in a Peanut Shell
Tab Controls
Add a Tab Control to a Window
Add Controls to a User Pane
Write a Handler for the Tab Controls and Panes
Epilogue
A. Additional Resources
Building Your Mac OS X Library
Inside Mac OS X: System Overview
Inside Mac OS X: Aqua Human Interface Guidelines
Inside Carbon: Carbon Porting Guide
Discovering QuickTime
Tapping the Carbon Developer Community
Mac DevCenter
MacTech Magazine
The MacDev-1 Email List
Carbon Development Email List
Keeping Current
Getting Sample Code
Registering Creator Codes
Partnering with Apple
B. Carbon Event Classesand Kinds
C. Parameter Names and Typesfor Common Event Kinds
Apple Events
Control Events
Command Events
Menu Events
Mouse Events
Text Input Events
Window Events
Index
Colophon
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Cover
Next
Next Chapter
Preface
Learning Carbon
Apple Computer Inc
Editor
Chuck Toporek
Copyright © 2001 Apple Computer Inc
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset